Commit 9d7fc860 authored by ck's avatar ck
Browse files

Maemo: Add watcher for project files.

Reviewed-by: kh1
parent 70e801bb
......@@ -219,7 +219,7 @@ QString MaemoDeployableListModel::projectName() const
QString MaemoDeployableListModel::projectDir() const
{
return m_proFileNode->path();
return QFileInfo(m_proFileNode->path()).dir().path();
}
} // namespace Qt4ProjectManager
......
......@@ -56,16 +56,24 @@ namespace Qt4ProjectManager {
namespace Internal {
MaemoDeployables::MaemoDeployables(MaemoPackageCreationStep *packagingStep)
: m_packagingStep(packagingStep)
: m_packagingStep(packagingStep), m_proFilesWatcher(0)
{
QTimer::singleShot(0, this, SLOT(createModels()));
}
void MaemoDeployables::createModels()
{
const Qt4ProFileNode *rootNode = m_packagingStep->qt4BuildConfiguration()
m_listModels.clear();
Qt4ProFileNode *rootNode = m_packagingStep->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);
}
emit modelsCreated();
}
......
......@@ -51,6 +51,7 @@ namespace Qt4ProjectManager {
namespace Internal {
class MaemoDeployableListModel;
class MaemoPackageCreationStep;
class Qt4NodesWatcher;
class Qt4ProFileNode;
class MaemoDeployables : public QObject
......@@ -75,6 +76,7 @@ private:
QList<MaemoDeployableListModel *> m_listModels;
MaemoPackageCreationStep * const m_packagingStep;
Qt4NodesWatcher *m_proFilesWatcher;
};
} // namespace Qt4ProjectManager
......
......@@ -71,12 +71,9 @@ MaemoPackageCreationWidget::MaemoPackageCreationWidget(MaemoPackageCreationStep
m_ui->patch->setValue(list.value(2, QLatin1String("0")).toInt());
versionInfoChanged();
if (step->deployables()->modelCount() > 0) {
handleModelsCreated();
} else {
connect(m_step->deployables(), SIGNAL(modelsCreated()), this,
SLOT(handleModelsCreated()));
}
connect(m_step->deployables(), SIGNAL(modelsCreated()), this,
SLOT(handleModelsCreated()));
handleModelsCreated();
}
void MaemoPackageCreationWidget::init()
......@@ -107,6 +104,7 @@ void MaemoPackageCreationWidget::versionInfoChanged()
void MaemoPackageCreationWidget::handleModelsCreated()
{
m_ui->tabWidget->clear();
for (int i = 0; i < m_step->deployables()->modelCount(); ++i) {
MaemoDeployableListModel * const model
= m_step->deployables()->modelAt(i);
......
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