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

List:       kde-commits
Subject:    branches/KDE/4.5/kdepim/messagecore
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-10-16 20:46:31
Message-ID: 20101016204631.B10CAAC898 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1186547 by tokoe:

Reduce calls to contentType()


 M  +8 -4      nodehelper.cpp  


--- branches/KDE/4.5/kdepim/messagecore/nodehelper.cpp #1186546:1186547
@@ -76,9 +76,11 @@
 {
   if ( node->head().isEmpty() )
     return false;
-  if ( node->contentType( false ) &&
-       node->contentType()->mediaType().toLower() == "message" &&
-       node->contentType()->subType().toLower() == "rfc822" ) {
+
+  const KMime::Headers::ContentType * const contentType = node ? node->contentType( false ) : 0;
+  if ( contentType &&
+       contentType->mediaType().toLower() == "message" &&
+       contentType->subType().toLower() == "rfc822" ) {
     // Messages are always attachments. Normally message attachments created from KMail have a content
     // disposition, but some mail clients omit that.
     return true;
@@ -92,7 +94,9 @@
 {
   if ( isAttachment( node ) )
     return true;
-  if ( ( node->contentType( false ) && !node->contentType()->name().isEmpty() ) ||
+
+  const KMime::Headers::ContentType * const contentType = node ? node->contentType( false ) : 0;
+  if ( ( contentType && !contentType->name().isEmpty() ) ||
        ( node->contentDisposition( false ) && !node->contentDisposition()->filename().isEmpty() ) )
     return true;
   return false;
[prev in list] [next in list] [prev in thread] [next in thread] 

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