From cd3435a9835dda6c0d5cc2295c5642c47045caca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Mon, 26 Oct 2009 15:31:43 +0100
Subject: [PATCH] Don't needlessly call updateProjectInfo()

Should not be necessary when nothing changed in the project info. This
also fixes a problem where include file scanning happened twice after
saving a pro file.

Reviewed-by: Roberto Raggi
---
 src/plugins/cpptools/cppmodelmanager.cpp     | 3 +--
 src/plugins/qt4projectmanager/qt4project.cpp | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index 1d886920566..75f8f743b38 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -331,9 +331,8 @@ void CppPreprocessor::resetEnvironment()
 
 bool CppPreprocessor::includeFile(const QString &absoluteFilePath, QString *result)
 {
-    if (absoluteFilePath.isEmpty() || m_included.contains(absoluteFilePath)) {
+    if (absoluteFilePath.isEmpty() || m_included.contains(absoluteFilePath))
         return true;
-    }
 
     if (m_workingCopy.contains(absoluteFilePath)) {
         m_included.insert(absoluteFilePath);
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index c58793bed76..96c080087a8 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -698,7 +698,7 @@ void Qt4Project::updateCodeModel()
             pinfo.includePaths == allIncludePaths     &&
             pinfo.frameworkPaths == allFrameworkPaths &&
             pinfo.sourceFiles == files) {
-        modelmanager->updateProjectInfo(pinfo);
+        // Nothing to update...
     } else {
         if (pinfo.defines != predefinedMacros         ||
             pinfo.includePaths != allIncludePaths     ||
-- 
GitLab