diff options
author | Pawel Polanski <pawel.3.polanski@nokia.com> | 2010-12-14 16:19:44 +0100 |
---|---|---|
committer | Pawel Polanski <pawel.3.polanski@nokia.com> | 2010-12-14 16:37:50 +0100 |
commit | 057591e0dd663a838bfacba9d671a2f1a82a1a9e (patch) | |
tree | 8366ed8b51e1845b09972e47b5bf89bbd29deac2 /src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp | |
parent | 5ed78fb633b448488d7ed2c758d0bf818e0a20b5 (diff) | |
download | qt-creator-057591e0dd663a838bfacba9d671a2f1a82a1a9e.tar.gz |
If capabilities inside pro files do not match the dev cert an error is generated (SymbianOS)
Diffstat (limited to 'src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp')
-rw-r--r-- | src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp index 386181025a..496f34db27 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp @@ -180,8 +180,12 @@ bool S60CreatePackageStep::init() QList<Qt4ProFileNode *> nodes = pro->leafProFiles(); m_workingDirectories.clear(); - foreach (Qt4ProFileNode *node, nodes) + QStringList projectCapabilities; + foreach (Qt4ProFileNode *node, nodes) { + projectCapabilities += node->symbianCapabilities(); m_workingDirectories << node->buildDir(); + } + projectCapabilities.removeDuplicates(); m_makeCmd = qt4BuildConfiguration()->makeCommand(); if (!QFileInfo(m_makeCmd).isAbsolute()) { @@ -194,7 +198,7 @@ bool S60CreatePackageStep::init() m_makeCmd = tmp; } - if (signingMode() == SignCustom && !validateCustomSigningResources()) + if (signingMode() == SignCustom && !validateCustomSigningResources(projectCapabilities)) return false; m_environment = qt4BuildConfiguration()->environment(); @@ -443,7 +447,7 @@ bool S60CreatePackageStep::createOnePackage() return true; } -bool S60CreatePackageStep::validateCustomSigningResources() +bool S60CreatePackageStep::validateCustomSigningResources(const QStringList &capabilitiesInPro) { Q_ASSERT(signingMode() == SignCustom); @@ -463,37 +467,50 @@ bool S60CreatePackageStep::validateCustomSigningResources() "Please define certificate file in the project's options.").arg(customKeyPath()); if (!errorString.isEmpty()) { - emit addOutput(errorString, BuildStep::ErrorMessageOutput); - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, - errorString, - QString(), -1, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + reportPackageStepIssue(errorString, true); return false; } QScopedPointer<S60CertificateInfo> certInfoPtr(new S60CertificateInfo(customSignaturePath())); S60CertificateInfo::CertificateState certState = certInfoPtr.data()->validateCertificate(); switch (certState) { case S60CertificateInfo::CertificateError: - emit addOutput(certInfoPtr.data()->errorString(), BuildStep::ErrorMessageOutput); - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, - certInfoPtr.data()->errorString(), - QString(), -1, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + reportPackageStepIssue(certInfoPtr.data()->errorString(), true); return false; case S60CertificateInfo::CertificateWarning: - emit addOutput(certInfoPtr.data()->errorString(), BuildStep::MessageOutput); - emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, - certInfoPtr.data()->errorString(), - QString(), -1, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + reportPackageStepIssue(certInfoPtr.data()->errorString(), false); break; default: break; } + + QStringList unsupportedCaps; + if (certInfoPtr.data()->compareCapabilities(capabilitiesInPro, unsupportedCaps)) { + if (!unsupportedCaps.isEmpty()) { + QString message = tr("The created package will not install on a " + "device as some of the defined capabilities " + "are not supported by the certificate: %1") + .arg(unsupportedCaps.join(" ")); + reportPackageStepIssue(message, true); + return false; + } + + } else + reportPackageStepIssue(certInfoPtr.data()->errorString(), false); return true; } - +void S60CreatePackageStep::reportPackageStepIssue(const QString &message, bool isError ) +{ + emit addOutput(message, isError? + BuildStep::ErrorMessageOutput: + BuildStep::MessageOutput); + emit addTask(ProjectExplorer::Task(isError? + ProjectExplorer::Task::Error: + ProjectExplorer::Task::Warning, + message, + QString(), -1, + ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); +} void S60CreatePackageStep::packageWarningDialogDone() { |