logic: Avoid reparsing when no project files nothing changed

This commit is contained in:
Eberhard Graether
2016-06-13 23:21:35 +02:00
parent 986f67df8e
commit 72a48f997f
3 changed files with 12 additions and 7 deletions
+10 -6
View File
@@ -150,18 +150,24 @@ void Project::parseCode()
utility::append(updatedFilePaths, m_storage->getDependingFilePaths(updatedFilePaths));
utility::append(updatedFilePaths, m_storage->getDependingFilePaths(removedFilePaths));
std::shared_ptr<TaskGroupSequential> taskSequential = std::make_shared<TaskGroupSequential>();
std::vector<FilePath> filesToClean;
filesToClean.insert(filesToClean.end(), removedFilePaths.begin(), removedFilePaths.end());
filesToClean.insert(filesToClean.end(), updatedFilePaths.begin(), updatedFilePaths.end());
taskSequential->addTask(std::make_shared<TaskCleanStorage>(m_storage.get(), filesToClean));
std::vector<FilePath> filesToParse;
filesToParse.insert(filesToParse.end(), addedFilePaths.begin(), addedFilePaths.end());
filesToParse.insert(filesToParse.end(), updatedFilePaths.begin(), updatedFilePaths.end());
m_state = PROJECT_LOADED;
if (!filesToClean.size() && !filesToParse.size())
{
MessageFinishedParsing(0, 0, 0, true).dispatch();
return;
}
std::shared_ptr<TaskGroupSequential> taskSequential = std::make_shared<TaskGroupSequential>();
taskSequential->addTask(std::make_shared<TaskCleanStorage>(m_storage.get(), filesToClean));
int indexerThreadCount = ApplicationSettings::getInstance()->getIndexerThreadCount();
@@ -189,8 +195,6 @@ void Project::parseCode()
}
Task::dispatch(taskSequential);
m_state = PROJECT_LOADED;
}
void Project::logStats() const