summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordt_ <qtc-committer@nokia.com>2011-05-30 13:11:31 +0200
committerDaniel Teske <daniel.teske@nokia.com>2011-05-30 14:05:27 +0200
commit8ea4b9700d956b2f9198439bf72dfe951cb8b56a (patch)
tree933fe6e9c7ed48fd89bfca3864244751e5331ff2 /src/plugins
parent6b0e6072f55404a32d3df00386a031771412656a (diff)
downloadqt-creator-8ea4b9700d956b2f9198439bf72dfe951cb8b56a.tar.gz
Qt4Project: fix canceling codemodel prevents codemodel update
After a cancel the next codemodel needs to start regardless of whether the underlying information is still the same. Change-Id: I24eecaf2b8f5c96904002ca1e3dbe4df0061cc9c Reviewed-on: http://codereview.qt.nokia.com/216 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qt4projectmanager/qt4project.cpp8
-rw-r--r--src/plugins/qt4projectmanager/qt4project.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index f4f68ba9a8..a9ae9c73ec 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -263,7 +263,8 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
m_asyncUpdateFutureInterface(0),
m_pendingEvaluateFuturesCount(0),
m_asyncUpdateState(NoState),
- m_cancelEvaluate(false)
+ m_cancelEvaluate(false),
+ m_codeModelCanceled(false)
{
setProjectContext(Core::Context(Qt4ProjectManager::Constants::PROJECT_ID));
setProjectLanguage(Core::Context(ProjectExplorer::Constants::LANG_CXX));
@@ -513,7 +514,8 @@ void Qt4Project::updateCppCodeModel()
&& pinfo.includePaths == allIncludePaths
&& pinfo.frameworkPaths == allFrameworkPaths
&& fileList
- && pinfo.precompiledHeaders == allPrecompileHeaders) {
+ && pinfo.precompiledHeaders == allPrecompileHeaders
+ && !m_codeModelCanceled) {
// Nothing to update...
} else {
pinfo.sourceFiles.clear();
@@ -534,6 +536,7 @@ void Qt4Project::updateCppCodeModel()
modelmanager->updateProjectInfo(pinfo);
m_codeModelFuture = modelmanager->updateSourceFiles(pinfo.sourceFiles);
+ m_codeModelCanceled = false;
}
}
@@ -687,6 +690,7 @@ void Qt4Project::scheduleAsyncUpdate()
// Cancel running code model update
m_codeModelFuture.cancel();
+ m_codeModelCanceled = true;
}
diff --git a/src/plugins/qt4projectmanager/qt4project.h b/src/plugins/qt4projectmanager/qt4project.h
index c9a5f02036..169367dc77 100644
--- a/src/plugins/qt4projectmanager/qt4project.h
+++ b/src/plugins/qt4projectmanager/qt4project.h
@@ -250,6 +250,7 @@ private:
enum AsyncUpdateState { NoState, Base, AsyncFullUpdatePending, AsyncPartialUpdatePending, AsyncUpdateInProgress, ShuttingDown };
AsyncUpdateState m_asyncUpdateState;
bool m_cancelEvaluate;
+ bool m_codeModelCanceled;
QList<Qt4ProFileNode *> m_partialEvaluate;
QFuture<void> m_codeModelFuture;