From ed5f9bf0fea65b2413a76b767456bdf3ac8008fb Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 26 Nov 2010 09:45:10 +0100 Subject: [PATCH] Maemo: For deployment, use our models directly. Don't waste time going through the Qt4ProFileNodes. --- .../qt-maemo/maemodeployablelistmodel.h | 2 ++ .../qt-maemo/maemopackagecreationstep.cpp | 25 ++++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h index a90d4883fa..a297433ab5 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.h @@ -66,6 +66,8 @@ public: QString projectName() const { return m_projectName; } QString projectDir() const; QString proFilePath() const { return m_proFilePath; } + bool isApplicationProject() const { return m_projectType == ApplicationTemplate; } + QString applicationName() const { return m_targetInfo.target; } bool hasTargetPath() const { return m_hasTargetPath; } bool canAddDesktopFile() const; bool canAddIcon() const; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp index 1023548d04..4d3a32c96d 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp @@ -598,28 +598,21 @@ void MaemoPackageCreationStep::updateDesktopFiles(const QString &rulesFilePath) desktopFileDir.remove(QLatin1Char(':')); desktopFileDir.prepend(QLatin1Char('/')); #endif - const QList &proFiles = qt4BuildConfiguration() - ->qt4Target()->qt4Project()->applicationProFiles(); - int insertPos = makeInstallEol + 1; - foreach (const Qt4ProFileNode * const proFile, proFiles) { - const QString appName = proFile->targetInformation().target; + int insertPos = makeInstallEol + 1; + for (int i = 0; i < deployStep()->deployables()->modelCount(); ++i) { + const MaemoDeployableListModel * const model + = deployStep()->deployables()->modelAt(i); + if (!model->isApplicationProject()) + continue; + const QString appName = model->applicationName(); if (maemoToolChain()->version() == MaemoToolChain::Maemo6) { addWorkaroundForHarmattanBug(content, insertPos, appName, desktopFileDir); } - - QString executableFilePath; - for (int i = 0; i < deployStep()->deployables()->modelCount(); ++i) { - const MaemoDeployableListModel * const model - = deployStep()->deployables()->modelAt(i); - if (model->proFilePath() == proFile->path()) { - executableFilePath = model->remoteExecutableFilePath(); - break; - } - } + const QString executableFilePath = model->remoteExecutableFilePath(); if (executableFilePath.isEmpty()) { qDebug("%s: Skipping subproject %s with missing deployment information.", - Q_FUNC_INFO, qPrintable(proFile->path())); + Q_FUNC_INFO, qPrintable(model->proFilePath())); continue; } const QByteArray lineBefore("Exec=.*"); -- 2.11.0