From 1bde4ddbeca28f33d3c9bcaea6b48851d11444f3 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Jul 2021 16:49:42 +0200 Subject: ProjectExplorer: Use FilePaths in project tree nodes Change-Id: I31b15c428d9b962333947b1e32641fd80f61d069 Reviewed-by: Christian Stenger --- src/plugins/python/pythonproject.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/plugins/python/pythonproject.cpp') diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index e453d5c366..890bcd10fb 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -63,9 +63,9 @@ public: explicit PythonBuildSystem(Target *target); bool supportsAction(Node *context, ProjectAction action, const Node *node) const override; - bool addFiles(Node *, const QStringList &filePaths, QStringList *) override; - RemovedFilesFromProject removeFiles(Node *, const QStringList &filePaths, QStringList *) override; - bool deleteFiles(Node *, const QStringList &) override; + bool addFiles(Node *, const Utils::FilePaths &filePaths, Utils::FilePaths *) override; + RemovedFilesFromProject removeFiles(Node *, const Utils::FilePaths &filePaths, Utils::FilePaths *) override; + bool deleteFiles(Node *, const Utils::FilePaths &) override; bool renameFile(Node *, const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath) override; @@ -349,23 +349,23 @@ bool PythonBuildSystem::writePyProjectFile(const QString &fileName, QString &con return true; } -bool PythonBuildSystem::addFiles(Node *, const QStringList &filePaths, QStringList *) +bool PythonBuildSystem::addFiles(Node *, const FilePaths &filePaths, FilePaths *) { QStringList newList = m_rawFileList; const QDir baseDir(projectDirectory().toString()); - for (const QString &filePath : filePaths) - newList.append(baseDir.relativeFilePath(filePath)); + for (const FilePath &filePath : filePaths) + newList.append(baseDir.relativeFilePath(filePath.toString())); return saveRawFileList(newList); } -RemovedFilesFromProject PythonBuildSystem::removeFiles(Node *, const QStringList &filePaths, QStringList *) +RemovedFilesFromProject PythonBuildSystem::removeFiles(Node *, const FilePaths &filePaths, FilePaths *) { QStringList newList = m_rawFileList; - for (const QString &filePath : filePaths) { - const QHash::iterator i = m_rawListEntries.find(filePath); + for (const FilePath &filePath : filePaths) { + const QHash::iterator i = m_rawListEntries.find(filePath.toString()); if (i != m_rawListEntries.end()) newList.removeOne(i.value()); } @@ -375,7 +375,7 @@ RemovedFilesFromProject PythonBuildSystem::removeFiles(Node *, const QStringList return res ? RemovedFilesFromProject::Ok : RemovedFilesFromProject::Error; } -bool PythonBuildSystem::deleteFiles(Node *, const QStringList &) +bool PythonBuildSystem::deleteFiles(Node *, const FilePaths &) { return true; } -- cgit v1.2.1