diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp index bae7dd37229..1c3553c44f4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp @@ -176,8 +176,14 @@ bool S60CreatePackageStep::init() m_environment = qt4BuildConfiguration()->environment(); m_args.clear(); - if (m_createSmartInstaller) - m_args << QLatin1String("installer_sis"); + if (m_createSmartInstaller) { + if(signingMode() == NotSigned) + m_args << QLatin1String("unsigned_installer_sis"); + else + m_args << QLatin1String("installer_sis"); + + } else if (signingMode() == NotSigned) + m_args << QLatin1String("unsigned_sis"); else m_args << QLatin1String("sis"); if (signingMode() == SignCustom) { @@ -645,6 +651,8 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack this, SLOT(updateFromUi())); connect(m_ui.selfSignedButton, SIGNAL(clicked()), this, SLOT(updateFromUi())); + connect(m_ui.notSignedButton, SIGNAL(clicked()), + this, SLOT(updateFromUi())); connect(m_ui.signaturePath, SIGNAL(changed(QString)), this, SLOT(updateFromUi())); connect(m_ui.keyFilePath, SIGNAL(changed(QString)), @@ -657,11 +665,27 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack void S60CreatePackageStepConfigWidget::updateUi() { - bool selfSigned = m_signStep->signingMode() == S60CreatePackageStep::SignSelf; - m_ui.selfSignedButton->setChecked(selfSigned); - m_ui.customCertificateButton->setChecked(!selfSigned); - m_ui.signaturePath->setEnabled(!selfSigned); - m_ui.keyFilePath->setEnabled(!selfSigned); + + switch(m_signStep->signingMode()) { + case S60CreatePackageStep::SignCustom: + m_ui.selfSignedButton->setChecked(false); + m_ui.customCertificateButton->setChecked(true); + m_ui.notSignedButton->setChecked(false); + break; + case S60CreatePackageStep::NotSigned: + m_ui.selfSignedButton->setChecked(false); + m_ui.customCertificateButton->setChecked(false); + m_ui.notSignedButton->setChecked(true); + break; + default: + m_ui.selfSignedButton->setChecked(true); + m_ui.customCertificateButton->setChecked(false); + m_ui.notSignedButton->setChecked(false); + break; + } + bool customSigned = m_signStep->signingMode() == S60CreatePackageStep::SignCustom; + m_ui.signaturePath->setEnabled(customSigned); + m_ui.keyFilePath->setEnabled(customSigned); m_ui.signaturePath->setPath(m_signStep->customSignaturePath()); m_ui.keyFilePath->setPath(m_signStep->customKeyPath()); m_ui.smartInstaller->setChecked(m_signStep->createsSmartInstaller()); @@ -670,9 +694,15 @@ void S60CreatePackageStepConfigWidget::updateUi() void S60CreatePackageStepConfigWidget::updateFromUi() { - bool selfSigned = m_ui.selfSignedButton->isChecked(); - m_signStep->setSigningMode(selfSigned ? S60CreatePackageStep::SignSelf - : S60CreatePackageStep::SignCustom); + S60CreatePackageStep::SigningMode signingMode(S60CreatePackageStep::SignSelf); + if (m_ui.selfSignedButton->isChecked()) + signingMode = S60CreatePackageStep::SignSelf; + else if (m_ui.customCertificateButton->isChecked()) + signingMode = S60CreatePackageStep::SignCustom; + else if (m_ui.notSignedButton->isChecked()) + signingMode = S60CreatePackageStep::NotSigned; + + m_signStep->setSigningMode(signingMode); m_signStep->setCustomSignaturePath(m_ui.signaturePath->path()); m_signStep->setCustomKeyPath(m_ui.keyFilePath->path()); m_signStep->setCreatesSmartInstaller(m_ui.smartInstaller->isChecked()); @@ -691,11 +721,17 @@ void S60CreatePackageStepConfigWidget::resetPassphrases() QString S60CreatePackageStepConfigWidget::summaryText() const { QString text; - if (m_signStep->signingMode() == S60CreatePackageStep::SignSelf) { - text = tr("self-signed"); - } else { + switch(m_signStep->signingMode()) { + case S60CreatePackageStep::SignCustom: text = tr("signed with certificate %1 and key file %2") .arg(m_signStep->customSignaturePath(), m_signStep->customKeyPath()); + break; + case S60CreatePackageStep::NotSigned: + text = tr("not signed"); + break; + default: + text = tr("self-signed"); + break; } if (m_signStep->createsSmartInstaller()) return tr("Create SIS Package: %1, using Smart Installer").arg(text); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h index 8cdc5ecb91c..b37e517f17d 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.h @@ -74,7 +74,8 @@ class S60CreatePackageStep : public ProjectExplorer::BuildStep public: enum SigningMode { SignSelf = 0, - SignCustom = 1 + SignCustom = 1, + NotSigned = 2 }; explicit S60CreatePackageStep(ProjectExplorer::BuildStepList *bsl); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui index a0278c33265..b9eccf5ad1a 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.ui @@ -7,7 +7,7 @@ 0 0 517 - 108 + 135 @@ -15,7 +15,31 @@ - + + + + + + + + + + + + + 0 + 0 + + + + Not signed + + + + + + + diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp index f3a4abb28a4..cd4a04a64e0 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.cpp @@ -147,13 +147,20 @@ QStringList S60DeployConfiguration::signedPackages() const continue; TargetInformation ti = node->targetInformation(); if (ti.valid) - result << ti.buildDir + QLatin1Char('/') + ti.target - + (runSmartInstaller() ? QLatin1String("_installer") : QLatin1String("")) - + QLatin1String(".sis"); + result << ti.buildDir + QLatin1Char('/') + createPackageName(ti.target); } return result; } +QString S60DeployConfiguration::createPackageName(const QString &baseName) const +{ + QString name(baseName); + name += isSigned() ? QLatin1String("") : QLatin1String("_unsigned"); + name += runSmartInstaller() ? QLatin1String("_installer") : QLatin1String(""); + name += QLatin1String(".sis"); + return name; +} + QStringList S60DeployConfiguration::packageFileNamesWithTargetInfo() const { QList leafs = qt4Target()->qt4Project()->leafProFiles(); @@ -216,6 +223,21 @@ bool S60DeployConfiguration::runSmartInstaller() const return false; } +bool S60DeployConfiguration::isSigned() const +{ + DeployConfiguration *dc = target()->activeDeployConfiguration(); + QTC_ASSERT(dc, return false); + BuildStepList *bsl = dc->stepList(); + QTC_ASSERT(bsl, return false); + QList steps = bsl->steps(); + foreach (const BuildStep *step, steps) { + if (const S60CreatePackageStep *packageStep = qobject_cast(step)) { + return packageStep->signingMode() != S60CreatePackageStep::NotSigned; + } + } + return false; +} + ProjectExplorer::ToolChain::ToolChainType S60DeployConfiguration::toolChainType() const { if (Qt4BuildConfiguration *bc = qobject_cast(target()->activeBuildConfiguration())) diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h index 198178dad22..1d299eedd94 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60deployconfiguration.h @@ -93,8 +93,10 @@ protected: private: void ctor(); bool runSmartInstaller() const; + bool isSigned() const; QString symbianPlatform() const; QString symbianTarget() const; + QString createPackageName(const QString &baseName) const; bool isDebug() const; bool isStaticLibrary(const Qt4ProFileNode &projectNode) const;