OSDN Git Service

Qt4Project: Update code models if a folder watch changes the file list.
authorChristian Kamm <christian.d.kamm@nokia.com>
Thu, 15 Sep 2011 10:15:10 +0000 (12:15 +0200)
committerDaniel Teske <daniel.teske@nokia.com>
Thu, 15 Sep 2011 10:30:44 +0000 (12:30 +0200)
Fixes: c861af529ec87b34f1ca45d917d367c345334859

Change-Id: I7ed8afd52ab694d053788fac7f3e994898f2dd84
Reviewed-on: http://codereview.qt-project.org/4969
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
src/plugins/qt4projectmanager/qt4nodes.cpp
src/plugins/qt4projectmanager/qt4project.cpp
src/plugins/qt4projectmanager/qt4project.h

index a66568b..4dc5b02 100644 (file)
@@ -733,6 +733,7 @@ void Qt4PriFileNode::folderChanged(const QString &folder)
 
     contents.updateSubFolders(this, this);
     m_project->updateFileList();
+    m_project->updateCodeModels();
 
     // The files to be packaged are listed inside the symbian build system.
     // We need to regenerate that list by running qmake
index 7c5cdaa..f1d00e1 100644 (file)
@@ -353,7 +353,6 @@ void Qt4Project::updateFileList()
     if (newFiles != *m_projectFiles) {
         *m_projectFiles = newFiles;
         emit fileListChanged();
-        updateCodeModels();
         if (debug)
             qDebug() << Q_FUNC_INFO << *m_projectFiles;
     }
@@ -393,6 +392,8 @@ bool Qt4Project::fromMap(const QVariantMap &map)
 
     update();
     updateFileList();
+    // This might be incorrect, need a full update
+    updateCodeModels();
 
     foreach (Target *t, targets())
         static_cast<Qt4BaseTarget *>(t)->createApplicationProFiles();
@@ -798,6 +799,7 @@ void Qt4Project::decrementPendingEvaluateFutures()
             foreach (Target *t, targets())
                 static_cast<Qt4BaseTarget *>(t)->createApplicationProFiles();
             updateFileList();
+            updateCodeModels();
             if (debug)
                 qDebug()<<"  Setting state to Base";
             m_asyncUpdateState = Base;
index ec55528..51007ab 100644 (file)
@@ -131,6 +131,7 @@ public:
 
     // For Qt4ProFileNode after a on disk change
     void updateFileList();
+    void updateCodeModels();
 
     void watchFolders(const QStringList &l, Qt4PriFileNode *node);
     void unwatchFolders(const QStringList &l, Qt4PriFileNode *node);
@@ -158,7 +159,6 @@ private slots:
 private:
     void scheduleAsyncUpdate();
 
-    void updateCodeModels();
     void updateCppCodeModel();
     void updateQmlJSCodeModel();