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

List:       kde-commits
Subject:    KDE/kdepim/messagelist
From:       Volker Krause <vkrause () kde ! org>
Date:       2010-10-16 19:34:39
Message-ID: 20101016193439.2BDD4AC896 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1186528 by vkrause:

Don't ask for the content type header seven times in a row, once is more
than enough. Speeds up updateMessageItemData() by about 20%.


 M  +8 -7      storagemodel.cpp  


--- trunk/KDE/kdepim/messagelist/storagemodel.cpp #1186527:1186528
@@ -316,9 +316,10 @@
   mi->setStatus( stat );
 
   mi->setEncryptionState( Core::MessageItem::EncryptionStateUnknown );
-  if ( mail->contentType()->isSubtype( "encrypted" )
-    || mail->contentType()->isSubtype( "pgp-encrypted" )
-    || mail->contentType()->isSubtype( "pkcs7-mime" ) ) {
+  const KMime::Headers::ContentType * const contentType = mail->contentType();
+  if ( contentType->isSubtype( "encrypted" )
+    || contentType->isSubtype( "pgp-encrypted" )
+    || contentType->isSubtype( "pkcs7-mime" ) ) {
       mi->setEncryptionState( Core::MessageItem::FullyEncrypted );
   } else if ( mail->mainBodyPart( "multipart/encrypted" )
            || mail->mainBodyPart( "application/pgp-encrypted" )
@@ -327,10 +328,10 @@
   }
 
   mi->setSignatureState( Core::MessageItem::SignatureStateUnknown );
-  if ( mail->contentType()->isSubtype( "signed" )
-    || mail->contentType()->isSubtype( "pgp-signature" )
-    || mail->contentType()->isSubtype( "pkcs7-signature" )
-    || mail->contentType()->isSubtype( "x-pkcs7-signature" ) ) {
+  if ( contentType->isSubtype( "signed" )
+    || contentType->isSubtype( "pgp-signature" )
+    || contentType->isSubtype( "pkcs7-signature" )
+    || contentType->isSubtype( "x-pkcs7-signature" ) ) {
       mi->setSignatureState( Core::MessageItem::FullySigned );
   } else if ( mail->mainBodyPart( "multipart/signed" )
            || mail->mainBodyPart( "application/pgp-signature" )
[prev in list] [next in list] [prev in thread] [next in thread] 

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