Commit 0cc983c8 authored by ck's avatar ck
Browse files

Maemo: Use existing project files watcher.

Also get rid of unneeded state.

Reviewed-by: kh1
parent 743a83b6
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
#include <qt4projectmanager/qt4buildconfiguration.h> #include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4target.h> #include <qt4projectmanager/qt4target.h>
...@@ -56,24 +55,24 @@ namespace Qt4ProjectManager { ...@@ -56,24 +55,24 @@ namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
MaemoDeployables::MaemoDeployables(const ProjectExplorer::BuildStep *buildStep) 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::createModels() void MaemoDeployables::init()
{ {
m_listModels.clear(); createModels();
Qt4ProFileNode *rootNode connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
= qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode();
createModels(rootNode);
if (!m_proFilesWatcher) {
m_proFilesWatcher = new Qt4NodesWatcher(this);
connect(m_proFilesWatcher,
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
this, SLOT(createModels())); this, SLOT(createModels()));
rootNode->registerWatcher(m_proFilesWatcher); }
}
void MaemoDeployables::createModels()
{
m_listModels.clear();
createModels(qt4BuildConfiguration()->qt4Target()->qt4Project()
->rootProjectNode());
emit modelsCreated(); emit modelsCreated();
} }
......
...@@ -54,7 +54,6 @@ namespace Internal { ...@@ -54,7 +54,6 @@ namespace Internal {
class MaemoDeployableListModel; class MaemoDeployableListModel;
class Qt4BuildConfiguration; class Qt4BuildConfiguration;
class Qt4NodesWatcher;
class Qt4ProFileNode; class Qt4ProFileNode;
class MaemoDeployables : public QObject class MaemoDeployables : public QObject
...@@ -75,12 +74,12 @@ signals: ...@@ -75,12 +74,12 @@ signals:
private: private:
Q_SLOT void createModels(); Q_SLOT void createModels();
Q_SLOT void init();
void createModels(const Qt4ProFileNode *proFileNode); void createModels(const Qt4ProFileNode *proFileNode);
const Qt4BuildConfiguration *qt4BuildConfiguration() const; const Qt4BuildConfiguration *qt4BuildConfiguration() const;
QList<MaemoDeployableListModel *> m_listModels; QList<MaemoDeployableListModel *> m_listModels;
const ProjectExplorer::BuildStep * const m_buildStep; const ProjectExplorer::BuildStep * const m_buildStep;
Qt4NodesWatcher *m_proFilesWatcher;
}; };
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment