Skip to content

Commit

Permalink
chore: remove some variable that never used.
Browse files Browse the repository at this point in the history
1. class member 'FileTreeModel::OutputFileRole' is never used.
2. Local variable 'pos' shadows outer varibale.
3. Variable 'tempPath' is assigned a value that is never used.
  • Loading branch information
GongHeng2017 authored and manisandro committed Jan 10, 2025
1 parent 88aa7b8 commit 7b25fcb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions qt/src/FileTreeModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ QModelIndex FileTreeModel::insertFile(QString filePath, DataObject* data, const
path = newPath.mid(pos);
QModelIndex idx = index(0, 0);
for(int i = 0, n = path.length(); i < n; ++i) {
int pos = cur->dirs.insIndex(path[i]);
pos = cur->dirs.insIndex(path[i]);
cur = cur->dirs.add(new DirNode(path[i], cur->path + "/" + path[i], cur), pos);
idx = index(pos, 0, idx);
}
Expand All @@ -164,11 +164,9 @@ QModelIndex FileTreeModel::findFile(const QString& filePath, bool isFile) const
#ifdef Q_OS_WIN32
QString prefix = "/";
QString fileDir = "/" + finfo.absolutePath().replace("\\", "/");
QString tempPath = "/" + QDir::tempPath();
#else
QString prefix = "";
QString fileDir = finfo.absolutePath();
QString tempPath = QDir::tempPath();
#endif
QString fileName = finfo.fileName();

Expand Down
2 changes: 0 additions & 2 deletions qt/src/FileTreeModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ public:
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;

static constexpr int OutputFileRole = Qt::UserRole;

private:
template<class T>
class NodeList : public std::vector<T> {
Expand Down

0 comments on commit 7b25fcb

Please sign in to comment.