diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 1708e62de35..313ea7f21ff 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -505,7 +505,7 @@ CppModelManager::ProjectInfo *CppModelManager::projectInfo(ProjectExplorer::Proj QFuture CppModelManager::refreshSourceFiles(const QStringList &sourceFiles) { - if (qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull()) { + if (! sourceFiles.isEmpty() && qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull()) { const QMap workingCopy = buildWorkingCopyList(); QFuture result = QtConcurrent::run(&CppModelManager::parse, this, @@ -657,6 +657,8 @@ void CppModelManager::parse(QFutureInterface &future, QStringList files, QMap workingCopy) { + Q_ASSERT(! files.isEmpty()); + // Change the priority of the background parser thread to idle. QThread::currentThread()->setPriority(QThread::IdlePriority); @@ -698,6 +700,8 @@ void CppModelManager::parse(QFutureInterface &future, #endif } + future.setProgressValue(files.size()); + // Restore the previous thread priority. QThread::currentThread()->setPriority(QThread::NormalPriority); }