forked from qt-creator/qt-creator
QmakePM: Do a "sorted insert" when adding files
Don't blindly append to the end of the list, but try to put files into the right place with regards to lexicographical order. We do not re-sort existing file lists, nor do we attempt to be fancy with strangely formatted project files. But lists conforming to our own style will stay sorted, in particular lists that have only ever been touched by Qt Creator. Fixes: QTCREATORBUG-553 Fixes: QTCREATORBUG-21807 Change-Id: I15db0e867a2d477fcf95e008f98ba468dcd83e45 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
@@ -542,6 +542,7 @@ bool QmakePriFile::addFiles(const QStringList &filePaths, QStringList *notAdded)
|
||||
if (!m_recursiveEnumerateFiles.contains(FileName::fromString(file)))
|
||||
uniqueFilePaths.append(file);
|
||||
}
|
||||
uniqueFilePaths.sort();
|
||||
|
||||
changeFiles(type, uniqueFilePaths, &failedFiles, AddToProFile);
|
||||
if (notAdded)
|
||||
|
||||
Reference in New Issue
Block a user