[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Volker Krause <vkrause () kde ! org>
Date:       2008-05-02 16:21:18
Message-ID: 1209745278.152226.19678.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 803343 by vkrause:

start() apparently doesn't emit result() if it returns an error
immediately, so don't enter the event loop in that case.


 M  +16 -4     kleojobexecutor.cpp  


--- trunk/KDE/kdepim/kmail/kleojobexecutor.cpp #803342:803343
@@ -48,7 +48,9 @@
   kDebug() << "Starting detached verification job";
   connect( job, SIGNAL(result(GpgME::VerificationResult)),
            SLOT(verificationResult(GpgME::VerificationResult)) );
-  job->start( signature, signedData );
+  GpgME::Error err = job->start( signature, signedData );
+  if ( err )
+    return VerificationResult( err );
   mEventLoop->exec();
   return mVerificationResult;
 }
@@ -61,7 +63,11 @@
   kDebug() << "Starting opaque verfication job";
   connect( job, SIGNAL(result(GpgME::VerificationResult,QByteArray)),
            SLOT(verificationResult(GpgME::VerificationResult,QByteArray)) );
-  job->start( signedData );
+  GpgME::Error err = job->start( signedData );
+  if ( err ) {
+    plainText.clear();
+    return VerificationResult( err );
+  }
   mEventLoop->exec();
   plainText = mData;
   return mVerificationResult;
@@ -75,7 +81,11 @@
   kDebug() << "Starting decryption job";
   connect( job, SIGNAL(result(GpgME::DecryptionResult,GpgME::VerificationResult,QByteArray)),
            SLOT(decryptResult(GpgME::DecryptionResult,GpgME::VerificationResult,QByteArray)) );
-  job->start( cipherText );
+  GpgME::Error err = job->start( cipherText );
+  if ( err ) {
+    plainText.clear();
+    return std::make_pair( DecryptionResult( err ), VerificationResult( err ) );
+  }
   mEventLoop->exec();
   plainText = mData;
   return std::make_pair( mDecryptResult, mVerificationResult );
@@ -84,7 +94,9 @@
 GpgME::ImportResult KleoJobExecutor::exec(Kleo::ImportJob* job, const QByteArray & certData)
 {
   connect( job, SIGNAL(result(GpgME::ImportResult)), SLOT(importResult(GpgME::ImportResult)) );
-  job->start( certData );
+  GpgME::Error err = job->start( certData );
+  if ( err )
+    return ImportResult( err );
   mEventLoop->exec();
   return mImportResult;
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic