diff options
| author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-07-13 00:28:23 +0200 |
|---|---|---|
| committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-07-13 00:28:23 +0200 |
| commit | 02062e44674ba88ea5ab62c806abb879d520ee43 (patch) | |
| tree | b43cf5fdfe7a2c1da4bcf652467966c9db64805e /context.cpp | |
| parent | updated TODO (diff) | |
| download | gpg4usb-02062e44674ba88ea5ab62c806abb879d520ee43.tar.gz gpg4usb-02062e44674ba88ea5ab62c806abb879d520ee43.zip | |
make sign undoable,change return value checkErr to int
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@495 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'context.cpp')
| -rw-r--r-- | context.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/context.cpp b/context.cpp index 52593bf..f54417d 100644 --- a/context.cpp +++ b/context.cpp @@ -447,20 +447,22 @@ void Context::clearPasswordCache() } // error-handling -void Context::checkErr(gpgme_error_t err, QString comment) const +int Context::checkErr(gpgme_error_t err, QString comment) const { //if (err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) { if (err != GPG_ERR_NO_ERROR) { qDebug() << "[Error " << comment << "] Source: " << gpgme_strsource(err) << " String: " << gpgme_strerror(err); } + return err; } -void Context::checkErr(gpgme_error_t err) const +int Context::checkErr(gpgme_error_t err) const { //if (err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) { if (err != GPG_ERR_NO_ERROR) { qDebug() << "[Error] Source: " << gpgme_strsource(err) << " String: " << gpgme_strerror(err); } + return err; } @@ -508,7 +510,11 @@ int Context::verify(QByteArray inBuffer) { checkErr(err); err = gpgme_op_verify (mCtx, in, NULL, in); - checkErr(err); + error = checkErr(err); + + if (error != 0) { + return 1; + } result = gpgme_op_verify_result (mCtx); |
