aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpgcontext.cpp6
-rw-r--r--main.cpp5
2 files changed, 7 insertions, 4 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp
index 89a6bab..cf9cd1e 100644
--- a/gpgcontext.cpp
+++ b/gpgcontext.cpp
@@ -374,7 +374,7 @@ bool GpgContext::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer)
err = gpgme_op_decrypt(mCtx, in, out);
checkErr(err);
- if(err) {
+ if(gpg_err_code(err) == GPG_ERR_DECRYPT_FAILED) {
errorString.append(gpgErrString(err)).append("<br>");
result = gpgme_op_decrypt_result(mCtx);
checkErr(result->recipients->status);
@@ -383,6 +383,8 @@ bool GpgContext::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer)
errorString.append(tr("<br>No private key with id "))
.append(result->recipients->keyid)
.append(tr(" in keyring."));
+ } else {
+ errorString.append(gpgErrString(err)).append("<br>");
}
if (!err) {
@@ -397,7 +399,7 @@ bool GpgContext::decrypt(const QByteArray &inBuffer, QByteArray *outBuffer)
}
}
}
- if (err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) {
+ if (gpg_err_code(err) != GPG_ERR_NO_ERROR && gpg_err_code(err) != GPG_ERR_CANCELED) {
QMessageBox::critical(0, tr("Error decrypting:"), errorString);
return false;
}
diff --git a/main.cpp b/main.cpp
index aaf4e81..1c9b4b7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -88,8 +88,9 @@ int main(int argc, char *argv[])
#endif
app.installTranslator(&translator2);
- /*foreach(QLocale l , QLocale::matchingLocales(lang, "", "")) {
- qDebug << "l: " << l.toString();
+ /*QLocale ql(lang);
+ foreach(QLocale l , QLocale::matchingLocales(ql.language(), ql.script(), ql.country())) {
+ qDebug() << "l: " << l.bcp47Name();
}*/
// css