From e085ae677f9680da96ecaba21947a134eb0e130b Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Tue, 13 May 2008 16:38:30 +0000 Subject: [PATCH] Don't crash when quickly switching signed messages. The problem was that the sub-event loop of KleoJobExecutor would process user input, which made it possible to switch messages while the job was being executed. That caused trouble when returning from the sub-event loop. Thanks to Volker for the solution. BUG: 162049 svn path=/trunk/KDE/kdepim/; revision=807341 --- kleojobexecutor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kleojobexecutor.cpp b/kleojobexecutor.cpp index 5c374ac53..11507b81b 100644 --- a/kleojobexecutor.cpp +++ b/kleojobexecutor.cpp @@ -51,7 +51,7 @@ GpgME::VerificationResult KleoJobExecutor::exec( GpgME::Error err = job->start( signature, signedData ); if ( err ) return VerificationResult( err ); - mEventLoop->exec(); + mEventLoop->exec( QEventLoop::ExcludeUserInputEvents ); return mVerificationResult; } @@ -68,7 +68,7 @@ GpgME::VerificationResult KleoJobExecutor::exec( plainText.clear(); return VerificationResult( err ); } - mEventLoop->exec(); + mEventLoop->exec( QEventLoop::ExcludeUserInputEvents ); plainText = mData; return mVerificationResult; } @@ -86,7 +86,7 @@ std::pair< GpgME::DecryptionResult, GpgME::VerificationResult > KleoJobExecutor: plainText.clear(); return std::make_pair( DecryptionResult( err ), VerificationResult( err ) ); } - mEventLoop->exec(); + mEventLoop->exec( QEventLoop::ExcludeUserInputEvents ); plainText = mData; return std::make_pair( mDecryptResult, mVerificationResult ); } @@ -97,7 +97,7 @@ GpgME::ImportResult KleoJobExecutor::exec(Kleo::ImportJob* job, const QByteArray GpgME::Error err = job->start( certData ); if ( err ) return ImportResult( err ); - mEventLoop->exec(); + mEventLoop->exec( QEventLoop::ExcludeUserInputEvents ); return mImportResult; }