SVN commit 645446 by wstephens:

Disallow closing the composer window whilst performing a sign operation, this causes a crash when using the 
non-gpg-agent PGP backend.
BUG#113580

svn path=/branches/kdepim/enterprise/kdepim/; revision=667962
wilder-work
Pradeepto Bhattacharya 19 years ago
parent 041853362c
commit 6016cf5936
  1. 2
      kmcomposewin.cpp
  2. 7
      messagecomposer.cpp
  3. 2
      messagecomposer.h

@ -2062,6 +2062,8 @@ bool KMComposeWin::queryClose ()
return false;
if ( kmkernel->shuttingDown() || kapp->sessionSaving() )
return true;
if ( mComposer && mComposer->isPerformingSignOperation() ) // since the non-gpg-agent gpg plugin gets a passphrase using QDialog::exec()
return false; // the user can try to close the window, which destroys mComposer mid-call.
if ( isModified() ) {
bool istemplate = ( mFolder!=0 && mFolder->isTemplates() );

@ -287,7 +287,7 @@ public:
MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
: QObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
mKeyResolver( 0 ), mIdentityUid( 0 )
mKeyResolver( 0 ), mIdentityUid( 0 ), mPerformingSignOperation( false )
{
}
@ -1590,9 +1590,10 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
}
if ( doSignBody ) {
mPerformingSignOperation = true; // this lets the KMComposeWin know if it is safe to close the window.
pgpSignedMsg( mEncodedBody, format );
mPerformingSignOperation = false;
if ( mSignature.isEmpty() ) {
kdDebug() << "signature was empty" << endl;
mRc = false;

@ -92,6 +92,7 @@ public:
return mMessageList;
}
bool isPerformingSignOperation() const { return mPerformingSignOperation; }
signals:
void done( bool );
@ -273,6 +274,7 @@ private:
QValueList<MessageComposerJob*> mJobs;
bool mEncryptWithChiasmus;
bool mPerformingSignOperation;
};
#endif /* MESSAGECOMPOSER_H */

Loading…
Cancel
Save