From 0cc983c801609ceda3554323a420368b65562e0e Mon Sep 17 00:00:00 2001 From: ck <qt-info@nokia.com> Date: Mon, 26 Jul 2010 17:31:58 +0200 Subject: [PATCH] Maemo: Use existing project files watcher. Also get rid of unneeded state. Reviewed-by: kh1 --- .../qt-maemo/maemodeployables.cpp | 25 +++++++++---------- .../qt-maemo/maemodeployables.h | 3 +-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp index 1c4b8fbd5b4..9f8d878afef 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp @@ -46,7 +46,6 @@ #include <projectexplorer/buildstep.h> #include <qt4projectmanager/qt4buildconfiguration.h> -#include <qt4projectmanager/qt4nodes.h> #include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4target.h> @@ -56,24 +55,24 @@ namespace Qt4ProjectManager { namespace Internal { MaemoDeployables::MaemoDeployables(const ProjectExplorer::BuildStep *buildStep) - : m_buildStep(buildStep), m_proFilesWatcher(0) + : m_buildStep(buildStep) { - QTimer::singleShot(0, this, SLOT(createModels())); + QTimer::singleShot(0, this, SLOT(init())); +} + +void MaemoDeployables::init() +{ + createModels(); + connect(qt4BuildConfiguration()->qt4Target()->qt4Project(), + SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), + this, SLOT(createModels())); } void MaemoDeployables::createModels() { m_listModels.clear(); - Qt4ProFileNode *rootNode - = qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode(); - createModels(rootNode); - if (!m_proFilesWatcher) { - m_proFilesWatcher = new Qt4NodesWatcher(this); - connect(m_proFilesWatcher, - SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), - this, SLOT(createModels())); - rootNode->registerWatcher(m_proFilesWatcher); - } + createModels(qt4BuildConfiguration()->qt4Target()->qt4Project() + ->rootProjectNode()); emit modelsCreated(); } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h index 1e46b91d823..9e4351f1d04 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h @@ -54,7 +54,6 @@ namespace Internal { class MaemoDeployableListModel; class Qt4BuildConfiguration; -class Qt4NodesWatcher; class Qt4ProFileNode; class MaemoDeployables : public QObject @@ -75,12 +74,12 @@ signals: private: Q_SLOT void createModels(); + Q_SLOT void init(); void createModels(const Qt4ProFileNode *proFileNode); const Qt4BuildConfiguration *qt4BuildConfiguration() const; QList<MaemoDeployableListModel *> m_listModels; const ProjectExplorer::BuildStep * const m_buildStep; - Qt4NodesWatcher *m_proFilesWatcher; }; } // namespace Qt4ProjectManager -- GitLab