OSDN Git Service

Qt4ProjectManager: Force a qmake run on change in the deploy folder
authordt <qtc-committer@nokia.com>
Fri, 3 Dec 2010 10:46:35 +0000 (11:46 +0100)
committercon <qtc-committer@nokia.com>
Mon, 6 Dec 2010 12:01:18 +0000 (13:01 +0100)
On a change to the deployment folder, we need to run qmake again to
recreate the pkg file, we do that by setting a flag on all qmakesteps
for symbian and saving/restoring that flag.

Reviewed-By: hunger
Task-Nr: QTCREATORBUG-3062

src/plugins/qt4projectmanager/qmakestep.cpp
src/plugins/qt4projectmanager/qt4nodes.cpp

index fe858f5..2d7bf1a 100644 (file)
@@ -54,6 +54,7 @@ namespace {
 const char * const QMAKE_BS_ID("QtProjectManager.QMakeBuildStep");
 
 const char * const QMAKE_ARGUMENTS_KEY("QtProjectManager.QMakeBuildStep.QMakeArguments");
+const char * const QMAKE_FORCED_KEY("QtProjectManager.QMakeBuildStep.QMakeForced");
 }
 
 QMakeStep::QMakeStep(BuildStepList *bsl) :
@@ -72,7 +73,7 @@ QMakeStep::QMakeStep(BuildStepList *bsl, const QString &id) :
 
 QMakeStep::QMakeStep(BuildStepList *bsl, QMakeStep *bs) :
     AbstractProcessStep(bsl, bs),
-    m_forced(false),
+    m_forced(bs->m_forced),
     m_userArgs(bs->m_userArgs)
 {
     ctor();
@@ -302,13 +303,14 @@ QVariantMap QMakeStep::toMap() const
 {
     QVariantMap map(AbstractProcessStep::toMap());
     map.insert(QLatin1String(QMAKE_ARGUMENTS_KEY), m_userArgs);
+    map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced);
     return map;
 }
 
 bool QMakeStep::fromMap(const QVariantMap &map)
 {
     m_userArgs = map.value(QLatin1String(QMAKE_ARGUMENTS_KEY)).toStringList();
-
+    m_forced = map.value(QLatin1String(QMAKE_FORCED_KEY), false).toBool();
     return BuildStep::fromMap(map);
 }
 
index b5601ed..a6d100b 100644 (file)
@@ -722,6 +722,24 @@ void Qt4PriFileNode::folderChanged(const QString &folder)
 
     contents.updateSubFolders(this, this);
     m_project->updateFileList();
+
+    // The files to be packaged are listed inside the symbian build system.
+    // We need to regenerate that list by running qmake
+    // Other platforms do not have a explicit list of files to package, but package
+    // directories
+    foreach (ProjectExplorer::Target *target, m_project->targets()) {
+        if (target->id() == Constants::S60_DEVICE_TARGET_ID) {
+            foreach (ProjectExplorer::BuildConfiguration *bc, target->buildConfigurations()) {
+                Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(bc);
+                if (qt4bc) {
+                    QMakeStep *qmakeStep = qt4bc->qmakeStep();
+                    if (qmakeStep)
+                        qmakeStep->setForced(true);
+                }
+            }
+        }
+    }
+
 }
 
 bool Qt4PriFileNode::deploysFolder(const QString &folder) const