From 592b44e9b513f9483a3b1a46151fe1105a6ffb4c Mon Sep 17 00:00:00 2001 From: dt <qtc-committer@nokia.com> Date: Fri, 3 Dec 2010 11:46:35 +0100 Subject: [PATCH] Qt4ProjectManager: Force a qmake run on change in the deploy folder 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 | 6 ++++-- src/plugins/qt4projectmanager/qt4nodes.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index fe858f5a7b5..2d7bf1a3d4f 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -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); } diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index b5601ed2ac2..a6d100bb1e9 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -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 -- GitLab