forked from qt-creator/qt-creator
		
	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:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -238,6 +238,8 @@ public:
 | 
			
		||||
 | 
			
		||||
    void renameIncludes(const QString &oldFileName, const QString &newFileName);
 | 
			
		||||
 | 
			
		||||
    void setBackendJobsPostponed(bool postponed);
 | 
			
		||||
 | 
			
		||||
signals:
 | 
			
		||||
    /// Project data might be locked while this is emitted.
 | 
			
		||||
    void aboutToRemoveFiles(const QStringList &files);
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,7 @@ public:
 | 
			
		||||
    virtual FollowSymbolInterface &followSymbolInterface() = 0;
 | 
			
		||||
    virtual RefactoringEngineInterface &refactoringEngineInterface() = 0;
 | 
			
		||||
    virtual std::unique_ptr<AbstractOverviewModel> createOverviewModel() = 0;
 | 
			
		||||
    virtual void setBackendJobsPostponed(bool yesno) = 0;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class CPPTOOLS_EXPORT ModelManagerSupportProvider
 | 
			
		||||
 
 | 
			
		||||
@@ -47,6 +47,7 @@ public:
 | 
			
		||||
    FollowSymbolInterface &followSymbolInterface() final;
 | 
			
		||||
    RefactoringEngineInterface &refactoringEngineInterface() final;
 | 
			
		||||
    std::unique_ptr<AbstractOverviewModel> createOverviewModel() final;
 | 
			
		||||
    void setBackendJobsPostponed(bool) final {}
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    QScopedPointer<CppCompletionAssistProvider> m_completionAssistProvider;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user