Commit d5aabcff authored by Pawel Polanski's avatar Pawel Polanski
Browse files

Simplified key selection for Symbian while choosing cert-key file pair

Reviewed-by: Tobias Hunger
parent 699495f0
......@@ -654,7 +654,7 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
connect(m_ui.notSignedButton, SIGNAL(clicked()),
this, SLOT(updateFromUi()));
connect(m_ui.signaturePath, SIGNAL(changed(QString)),
this, SLOT(updateFromUi()));
this, SLOT(signatureChanged(QString)));
connect(m_ui.keyFilePath, SIGNAL(changed(QString)),
this, SLOT(updateFromUi()));
connect(m_ui.smartInstaller, SIGNAL(clicked()),
......@@ -663,6 +663,31 @@ S60CreatePackageStepConfigWidget::S60CreatePackageStepConfigWidget(S60CreatePack
this, SLOT(resetPassphrases()));
}
void S60CreatePackageStepConfigWidget::signatureChanged(QString certFile)
{
if (!certFile.isEmpty() && m_ui.keyFilePath->path().isEmpty()) {
/* If a cert file is selected and there is not key file inserted,
then we check if there is a .key or .pem file in the folder with
the same base name as the cert file. This file is probably a key
file for this cert and the key field is then populated automatically
*/
QFileInfo certFileInfo(certFile);
QDir directory = QDir(certFileInfo.absolutePath());
QString keyFile(certFileInfo.baseName() + QLatin1String(".key"));
QString pemFile(certFileInfo.baseName() + QLatin1String(".pem"));
QStringList files;
QStringList keys;
keys << keyFile << pemFile;
files = directory.entryList(QStringList(keys),
QDir::Files | QDir::NoSymLinks);
m_ui.keyFilePath->setPath(files.isEmpty()?
QString():
directory.filePath(files[0]));
}
updateFromUi();
}
void S60CreatePackageStepConfigWidget::updateUi()
{
......
......@@ -180,6 +180,7 @@ private slots:
void updateUi();
void updateFromUi();
void resetPassphrases();
void signatureChanged(QString certFile);
private:
S60CreatePackageStep *m_signStep;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment