diff options
author | David Schulz <david.schulz@qt.io> | 2021-06-11 14:34:34 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2021-06-17 11:13:51 +0000 |
commit | f66df921d74c323d899f996d9ca520c224355a90 (patch) | |
tree | 42ef20fe9de0b55b756d9ba56b731d1a474c9c08 /src/plugins/python/pythonproject.cpp | |
parent | 55b91a76172a3235b4879daf0b675519d5b02db7 (diff) | |
download | qt-creator-f66df921d74c323d899f996d9ca520c224355a90.tar.gz |
Core: filepathify file renaming
Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/python/pythonproject.cpp')
-rw-r--r-- | src/plugins/python/pythonproject.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index e1304188ad..e453d5c366 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -66,7 +66,9 @@ public: bool addFiles(Node *, const QStringList &filePaths, QStringList *) override; RemovedFilesFromProject removeFiles(Node *, const QStringList &filePaths, QStringList *) override; bool deleteFiles(Node *, const QStringList &) override; - bool renameFile(Node *, const QString &filePath, const QString &newFilePath) override; + bool renameFile(Node *, + const Utils::FilePath &oldFilePath, + const Utils::FilePath &newFilePath) override; bool saveRawFileList(const QStringList &rawFileList); bool saveRawList(const QStringList &rawList, const QString &fileName); @@ -378,16 +380,16 @@ bool PythonBuildSystem::deleteFiles(Node *, const QStringList &) return true; } -bool PythonBuildSystem::renameFile(Node *, const QString &filePath, const QString &newFilePath) +bool PythonBuildSystem::renameFile(Node *, const FilePath &oldFilePath, const FilePath &newFilePath) { QStringList newList = m_rawFileList; - const QHash<QString, QString>::iterator i = m_rawListEntries.find(filePath); + const QHash<QString, QString>::iterator i = m_rawListEntries.find(oldFilePath.toString()); if (i != m_rawListEntries.end()) { const int index = newList.indexOf(i.value()); if (index != -1) { const QDir baseDir(projectDirectory().toString()); - newList.replace(index, baseDir.relativeFilePath(newFilePath)); + newList.replace(index, baseDir.relativeFilePath(newFilePath.toString())); } } |