aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythonproject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/python/pythonproject.cpp')
-rw-r--r--src/plugins/python/pythonproject.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp
index 50ffe379943..c9bb0f0b6ce 100644
--- a/src/plugins/python/pythonproject.cpp
+++ b/src/plugins/python/pythonproject.cpp
@@ -302,12 +302,21 @@ bool PythonBuildSystem::addFiles(Node *, const FilePaths &filePaths, FilePaths *
{
const Utils::FilePath projectDir = projectDirectory();
+ auto comp = [](const FileEntry &left, const FileEntry &right) {
+ return left.rawEntry < right.rawEntry;
+ };
+
+ const bool isSorted = std::is_sorted(m_files.begin(), m_files.end(), comp);
+
for (const FilePath &filePath : filePaths) {
if (!projectDir.isSameDevice(filePath))
return false;
m_files.append(FileEntry{filePath.relativePathFrom(projectDir).toString(), filePath});
}
+ if (isSorted)
+ std::sort(m_files.begin(), m_files.end(), comp);
+
return save();
}