summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-07 12:15:13 +0100
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-07 13:21:37 +0200
commit124311227de43b253852e8099475fd53e748c514 (patch)
tree6c7317645820ee9d5c6fbc368eb2a941809d0d98
parentb6a50a1a4c46b6b935a2b56c0f7362f324f2f35f (diff)
downloadqt-creator-124311227de43b253852e8099475fd53e748c514.tar.gz
Sort files to process
Change-Id: Iac23e40c3154bf143b91d0262418f90907758276 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
-rw-r--r--plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp b/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
index 17a63f3a20..b92150cc35 100644
--- a/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
+++ b/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
@@ -37,6 +37,8 @@
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
+#include <utils/algorithm.h>
+
#include <QLoggingCategory>
#include <QTemporaryDir>
@@ -191,11 +193,15 @@ bool ClangStaticAnalyzerRunControl::startEngine()
m_clangLogFileDir = temporaryDir.path();
// Collect files
- const QList<AnalyzeUnit> filesToProcess = unitsToAnalyze(m_projectInfo);
+ QList<AnalyzeUnit> unitsToProcess = unitsToAnalyze(m_projectInfo);
+ Utils::sort(unitsToProcess, [](const AnalyzeUnit &a1, const AnalyzeUnit &a2) -> bool {
+ return a1.file < a2.file;
+ });
+
qCDebug(LOG) << "Files to process:";
- foreach (const AnalyzeUnit &fileConfig, filesToProcess)
+ foreach (const AnalyzeUnit &fileConfig, unitsToProcess)
qCDebug(LOG) << fileConfig.file;
- m_unitsToProcess = filesToProcess;
+ m_unitsToProcess = unitsToProcess;
m_initialFilesToProcessSize = m_unitsToProcess.count();
m_filesAnalyzed = 0;
m_filesNotAnalyzed = 0;