Commit ee608dc1 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Remove superfluous window caption of error dialogs

"Error" is the default window caption/title used by KMessageBox::error.
parent 41c5b9c4
Pipeline #177352 passed with stage
in 5 minutes and 6 seconds
......@@ -147,8 +147,7 @@ void AuthenticatePIVCardApplicationCommand::Private::slotResult(const Error &err
return;
}
#endif
error(i18nc("@info", "Authenticating to the card failed: %1", QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Authenticating to the card failed: %1", QString::fromLatin1(err.asString())));
}
finished();
}
......
......@@ -161,8 +161,7 @@ void CertificateToPIVCardCommand::Private::startCertificateToPIVCard()
Data data(&dp);
const Error err = ctx->exportPublicKeys(certificate.primaryFingerprint(), data);
if (err) {
error(i18nc("@info", "Exporting the certificate failed: %1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Exporting the certificate failed: %1", QString::fromUtf8(err.asString())));
finished();
return;
}
......@@ -230,8 +229,7 @@ void CertificateToPIVCardCommand::certificateToPIVCardDone(const Error &err)
}
#endif
d->error(i18nc("@info", "Writing the certificate to the card failed: %1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
d->error(i18nc("@info", "Writing the certificate to the card failed: %1", QString::fromUtf8(err.asString())));
} else if (!err.isCanceled()) {
KMessageBox::information(d->parentWidgetOrView(),
i18nc("@info", "Writing the certificate to the card succeeded."),
......
......@@ -205,8 +205,7 @@ void ChangePinCommand::Private::slotResult(const GpgME::Error& err)
qCDebug(KLEOPATRA_LOG) << "ChangePinCommand::slotResult():"
<< err.asString() << "(" << err.code() << ")";
if (err) {
error(errorMessage(keyRef, mode, QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
error(errorMessage(keyRef, mode, QString::fromLatin1(err.asString())));
} else if (!err.isCanceled()) {
information(successMessage(keyRef, mode), i18nc("@title", "Success"));
ReaderStatus::mutableInstance()->updateStatus();
......
......@@ -184,8 +184,7 @@ void CreateCSRForCardKeyCommand::Private::slotDialogAccepted()
keyParameters.setEmail(dialog->email());
if (const Error err = job->start(keyParameters.toString())) {
error(i18nc("@info", "Creating a CSR for the card key failed:\n%1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Creating a CSR for the card key failed:\n%1", QString::fromUtf8(err.asString())));
finished();
}
}
......@@ -200,8 +199,7 @@ void CreateCSRForCardKeyCommand::Private::slotResult(const KeyGenerationResult &
if (result.error().isCanceled()) {
// do nothing
} else if (result.error()) {
error(i18nc("@info", "Creating a CSR for the card key failed:\n%1", QString::fromUtf8(result.error().asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Creating a CSR for the card key failed:\n%1", QString::fromUtf8(result.error().asString())));
} else {
const QUrl url = saveRequest(request);
if (!url.isEmpty()) {
......
......@@ -167,8 +167,7 @@ void CreateOpenPGPKeyFromCardKeysCommand::Private::slotResult(const Error &err)
if (err.isCanceled()) {
// do nothing
} else if (err) {
error(i18nc("@info", "Creating an OpenPGP key from the card keys failed: %1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Creating an OpenPGP key from the card keys failed: %1", QString::fromUtf8(err.asString())));
} else {
information(i18nc("@info", "Successfully generated an OpenPGP key from the card keys."),
i18nc("@title", "Success"));
......
......@@ -450,8 +450,7 @@ void KeyToCardCommand::keyToOpenPGPCardDone(const GpgME::Error &err)
{
if (err) {
d->error(i18nc("@info",
"Moving the key to the card failed: %1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
"Moving the key to the card failed: %1", QString::fromUtf8(err.asString())));
} else if (!err.isCanceled()) {
/* TODO DELETE_KEY is too strong, because it also deletes the stub
* of the secret key. I could not find out how GnuPG does this. Question
......@@ -486,8 +485,7 @@ void KeyToCardCommand::keyToPIVCardDone(const GpgME::Error &err)
#endif
d->error(i18nc("@info",
"Copying the key pair to the card failed: %1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
"Copying the key pair to the card failed: %1", QString::fromUtf8(err.asString())));
} else if (!err.isCanceled()) {
d->information(i18nc("@info", "Successfully copied the key pair to the card."),
i18nc("@title", "Success"));
......@@ -500,8 +498,7 @@ void KeyToCardCommand::keyToPIVCardDone(const GpgME::Error &err)
void KeyToCardCommand::deleteDone(const GpgME::Error &err)
{
if (err) {
d->error(i18nc("@info", "Failed to delete the key: %1", QString::fromUtf8(err.asString())),
i18nc("@title", "Error"));
d->error(i18nc("@info", "Failed to delete the key: %1", QString::fromUtf8(err.asString())));
}
d->finished();
}
......
......@@ -212,8 +212,7 @@ void PIVGenerateCardKeyCommand::Private::slotResult(const GpgME::Error& err)
}
#endif
error(i18nc("@info", "Generating key failed: %1", QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Generating key failed: %1", QString::fromLatin1(err.asString())));
} else if (!err.isCanceled()) {
information(i18nc("@info", "Key successfully generated."), i18nc("@title", "Success"));
ReaderStatus::mutableInstance()->updateStatus();
......
......@@ -175,8 +175,7 @@ void SetPIVCardApplicationAdministrationKeyCommand::Private::slotDialogAccepted(
const QByteArray newAdminKey2 = dialog->adminKey();
if (newAdminKey != newAdminKey2) {
error(i18nc("@info", "The two keys you have entered do not match. Please retry."),
i18nc("@title", "Error"));
error(i18nc("@info", "The two keys you have entered do not match. Please retry."));
newAdminKey.clear();
dialog = nullptr;
setAdminKey();
......@@ -205,8 +204,7 @@ void SetPIVCardApplicationAdministrationKeyCommand::Private::slotResult(const Gp
qCDebug(KLEOPATRA_LOG) << "SetPIVCardApplicationAdministrationKeyCommand::slotResult():"
<< err.asString() << "(" << err.code() << ")";
if (err) {
error(i18nc("@info", "Setting the PIV Card Application Administration Key failed: %1", QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
error(i18nc("@info", "Setting the PIV Card Application Administration Key failed: %1", QString::fromLatin1(err.asString())));
} else if (!err.isCanceled()) {
information(i18nc("@info", "PIV Card Application Administration Key set successfully."), i18nc("@title", "Success"));
ReaderStatus::mutableInstance()->updateStatus();
......
......@@ -311,8 +311,7 @@ void PGPCardWidget::genKeyDone(const GpgME::Error &err, const std::string &backu
{
if (err) {
KMessageBox::error(this, i18nc("@info",
"Failed to generate new key: %1", QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
"Failed to generate new key: %1", QString::fromLatin1(err.asString())));
return;
}
if (err.isCanceled()) {
......@@ -326,8 +325,7 @@ void PGPCardWidget::genKeyDone(const GpgME::Error &err, const std::string &backu
QStringLiteral("%1 (*.gpg)").arg(i18n("Backup Key")));
if (!target.isEmpty() && !QFile::copy(bkpFile, target)) {
KMessageBox::error(this, i18nc("@info",
"Failed to move backup. The backup key is still stored under: %1", bkpFile),
i18nc("@title", "Error"));
"Failed to move backup. The backup key is still stored under: %1", bkpFile));
} else if (!target.isEmpty()) {
QFile::remove(bkpFile);
}
......@@ -390,20 +388,17 @@ void PGPCardWidget::changeNameRequested()
// Some additional restrictions imposed by gnupg
if (text.contains(QLatin1Char('<'))) {
KMessageBox::error(this, i18nc("@info",
"The \"<\" character may not be used."),
i18nc("@title", "Error"));
"The \"<\" character may not be used."));
continue;
}
if (text.contains(QLatin1String(" "))) {
KMessageBox::error(this, i18nc("@info",
"Double spaces are not allowed"),
i18nc("@title", "Error"));
"Double spaces are not allowed"));
continue;
}
if (text.size() > 38) {
KMessageBox::error(this, i18nc("@info",
"The size of the name may not exceed 38 characters."),
i18nc("@title", "Error"));
"The size of the name may not exceed 38 characters."));
}
break;
}
......@@ -425,8 +420,7 @@ void PGPCardWidget::changeNameResult(const GpgME::Error &err)
{
if (err) {
KMessageBox::error(this, i18nc("@info",
"Name change failed: %1", QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
"Name change failed: %1", QString::fromLatin1(err.asString())));
return;
}
if (!err.isCanceled()) {
......@@ -452,8 +446,7 @@ void PGPCardWidget::changeUrlRequested()
// Some additional restrictions imposed by gnupg
if (text.size() > 254) {
KMessageBox::error(this, i18nc("@info",
"The size of the URL may not exceed 254 characters."),
i18nc("@title", "Error"));
"The size of the URL may not exceed 254 characters."));
}
break;
}
......@@ -472,8 +465,7 @@ void PGPCardWidget::changeUrlResult(const GpgME::Error &err)
{
if (err) {
KMessageBox::error(this, i18nc("@info",
"URL change failed: %1", QString::fromLatin1(err.asString())),
i18nc("@title", "Error"));
"URL change failed: %1", QString::fromLatin1(err.asString())));
return;
}
if (!err.isCanceled()) {
......
Supports Markdown
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