Coding style fixes.

This commit is contained in:
Florian Geyer 2012-06-11 18:39:16 +02:00
parent a5f7d0277f
commit 871cdc5bb8

View File

@ -49,38 +49,28 @@ void ChangeMasterKeyWidget::togglePassword(bool checked)
void ChangeMasterKeyWidget::createKeyFile() void ChangeMasterKeyWidget::createKeyFile()
{ {
QString fileName = fileDialog()->getSaveFileName(this, tr("CreateKeyFile..."), QString(), QString filters = QString("%1 (*.key);;%2 (*)").arg(tr("Key files"), tr("All files"));
tr("Key Files") + " (*.key);;" + tr("All files (*)")); QString fileName = fileDialog()->getSaveFileName(this, tr("Create Key File..."), QString(), filters);
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
QString errorMsg; QString errorMsg;
bool created = FileKey::create(fileName, &errorMsg); bool created = FileKey::create(fileName, &errorMsg);
if(!created) if (!created) {
{
QMessageBox::warning(this, tr("Error"), tr("Unable to create Key File : ") + errorMsg); QMessageBox::warning(this, tr("Error"), tr("Unable to create Key File : ") + errorMsg);
} }
else else {
{ m_ui->keyFileCombo->setEditText(fileName);
if(m_ui->keyFileGroup->isEnabled())
{
m_ui->keyFileCombo->setEditText(fileName);
}
return;
} }
} }
} }
void ChangeMasterKeyWidget::browseKeyFile() void ChangeMasterKeyWidget::browseKeyFile()
{ {
QString fileName = fileDialog()->getOpenFileName(this, tr("Select a key file"), QString(), QString filters = QString("%1 (*.key);;%2 (*)").arg(tr("Key files"), tr("All files"));
tr("Key Files") + " (*.key);;" + tr("All files (*)")); QString fileName = fileDialog()->getOpenFileName(this, tr("Select a key file"), QString(), filters);
if(!fileName.isEmpty()) if (!fileName.isEmpty()) {
{ m_ui->keyFileCombo->setEditText(fileName);
if(m_ui->keyFileGroup->isEnabled())
{
m_ui->keyFileCombo->setEditText(fileName);
}
} }
} }