Dump the gpgme result objects to kdDebug(). This should enable much better bug reports since no debugger is necessary anymore.

svn path=/branches/kdepim/enterprise/kdepim/; revision=935926
wilder-work
Marc Mutz 17 years ago
parent 0556f8bedc
commit 7986bbd89f
  1. 16
      messagecomposer.cpp
  2. 7
      objecttreeparser.cpp

@ -86,6 +86,7 @@
#include <gpgmepp/context.h>
#include <algorithm>
#include <sstream>
#include <memory>
// ## keep default values in sync with configuredialog.cpp, Security::CryptoTab::setup()
@ -2177,6 +2178,11 @@ void MessageComposer::pgpSignedMsg( const QByteArray& cText, Kleo::CryptoMessage
QByteArray signature;
const GpgME::SigningResult res =
job->exec( signingKeys, cText, signingMode( format ), signature );
{
std::stringstream ss;
ss << res;
kdDebug(5006) << ss.str().c_str() << endl;
}
if ( res.error().isCanceled() ) {
kdDebug() << "signing was canceled by user" << endl;
return;
@ -2226,6 +2232,11 @@ Kpgp::Result MessageComposer::pgpEncryptedMsg( QByteArray & encryptedBody,
const GpgME::EncryptionResult res =
job->exec( encryptionKeys, cText, true /* we do ownertrust ourselves */, encryptedBody );
{
std::stringstream ss;
ss << res;
kdDebug(5006) << ss.str().c_str() << endl;
}
if ( res.error().isCanceled() ) {
kdDebug() << "encryption was canceled by user" << endl;
return Kpgp::Canceled;
@ -2269,6 +2280,11 @@ Kpgp::Result MessageComposer::pgpSignedAndEncryptedMsg( QByteArray & encryptedBo
const std::pair<GpgME::SigningResult,GpgME::EncryptionResult> res =
job->exec( signingKeys, encryptionKeys, cText, false, encryptedBody );
{
std::stringstream ss;
ss << res.first << '\n' << res.second;
kdDebug(5006) << ss.str().c_str() << endl;
}
if ( res.first.error().isCanceled() || res.second.error().isCanceled() ) {
kdDebug() << "encrypt/sign was canceled by user" << endl;
return Kpgp::Canceled;

@ -108,6 +108,7 @@
// other headers
#include <memory>
#include <sstream>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@ -475,6 +476,9 @@ namespace KMail {
cryptPlugError = CANT_VERIFY_SIGNATURES;
}
}
std::stringstream ss;
ss << result;
kdDebug(5006) << ss.str().c_str() << endl;
signatures = result.signatures();
}
@ -718,6 +722,9 @@ bool ObjectTreeParser::okDecryptMIME( partNode& data,
const std::pair<GpgME::DecryptionResult,GpgME::VerificationResult> res = job->exec( ciphertext, plainText );
const GpgME::DecryptionResult & decryptResult = res.first;
const GpgME::VerificationResult & verifyResult = res.second;
std::stringstream ss;
ss << decryptResult << '\n' << verifyResult;
kdDebug(5006) << ss.str().c_str() << endl;
signatureFound = verifyResult.signatures().size() > 0;
signatures = verifyResult.signatures();
bDecryptionOk = !decryptResult.error();

Loading…
Cancel
Save