[Bug 103240] Draft messages forget the default GPG action

Till Adam <[email protected]>
Newsgroups gmane.comp.kde.devel.kmail
Message-ID <[email protected]>
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=103240         
adam kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From adam kde org  2007-08-20 13:45 -------
SVN commit 702320 by tilladam:

Make sure to store the state of the crypto actions when saving a mail to 
drafts, but only if the state of the mail itself should not be used as
indication of the state of the actions. This is governd by the option
to "never sign and encrypt when saving to drafts" in the security 
settings.

Prokde35-z item 44.
BUG: 103240



 M  +15 -0     kmcomposewin.cpp  


--- branches/kdepim/enterprise/kdepim/kmail/kmcomposewin.cpp #702319:702320
 @ -1835,6 +1835,10  @
       break;
   }
 
+  // if these headers are present, the state of the message should be overruled
+  mLastSignActionState = (mMsg->headerField( "X-KMail-SignatureActionEnabled" ) == "true");
+  mLastEncryptActionState = (mMsg->headerField( "X-KMail-EncryptActionEnabled" ) == "true");
+
   mLastIdentityHasSigningKey = !ident.pgpSigningKey().isEmpty() || !ident.smimeSigningKey().isEmpty();
   mLastIdentityHasEncryptionKey = !ident.pgpEncryptionKey().isEmpty() || !ident.smimeEncryptionKey().isEmpty();
 
 @ -4010,6 +4014,17  @
     }
   }
 
+  if (neverEncrypt && saveIn != KMComposeWin::None ) {
+      // we can't use the state of the mail itself, to remember the 
+      // signing and encryption state, so let's add a header instead
+    mMsg->setHeaderField( "X-KMail-SignatureActionEnabled", mSignAction->isChecked()? "true":"false" );
+    mMsg->setHeaderField( "X-KMail-EncryptActionEnabled", mEncryptAction->isChecked()? "true":"false"  );
+  } else {
+    mMsg->removeHeaderField( "X-KMail-SignatureActionEnabled" );
+    mMsg->removeHeaderField( "X-KMail-EncryptActionEnabled" );
+  }
+
+
   kdDebug(5006) << "KMComposeWin::doSend() - calling applyChanges()"
                 << endl;
   applyChanges( neverEncrypt );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.