Clang: Avoid starting backend jobs for inactive app and during VCS operations

...to reduce file locking on Windows caused by clangbackend's
parse/reparse jobs.

Considering inactive application state should help for external VCS
operations, e.g. on the command line. However, activating Qt Creator
while such a VCS operation runs might still lead to undesired behavior,
but this should be the less common case.

VCS operations started from within Qt Creator should see less locking
conflicts as we know when they start and finish. However, we just avoid
starting new jobs - there might be still jobs running.

Pending or new jobs will be started once Qt Creator is activated again
and all VCS operations finished.

Task-number: QTCREATORBUG-15449
Change-Id: I5f04c34f006e66162368efbdd58bd822a706f35e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-10-10 14:32:00 +02:00
parent 3f3ba92fe9
commit d67ddfb5d1
9 changed files with 69 additions and 6 deletions

View File

@@ -1326,6 +1326,11 @@ void CppModelManager::renameIncludes(const QString &oldFileName, const QString &
}
}
void CppModelManager::setBackendJobsPostponed(bool postponed)
{
d->m_activeModelManagerSupport->setBackendJobsPostponed(postponed);
}
void CppModelManager::onCoreAboutToClose()
{
Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);