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

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim/kmail
From:       Carsten Burghardt <burghardt () kde ! org>
Date:       2005-12-30 13:16:28
Message-ID: 1135948588.103617.6175.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 492609 by burghard:

Mimelib creates empty header fields when you ask for them and they do not
exist. So retrieve the Content-Type field only when it is present.
Prevents display problems with Thunderbird as reported on kdepim-users.
CCMAIL:listen@alexander.skwar.name



 M  +11 -8     kmmessage.cpp  


--- branches/KDE/3.5/kdepim/kmail/kmmessage.cpp #492608:492609
@@ -2791,13 +2791,14 @@
 
     // pending(khz): Find out WHY this look does not travel down *into* an
     //               embedded "Message/RfF822" message containing a "Multipart/Mixed"
-    if (curpart && curpart->hasHeaders() ) {
+    if ( curpart && curpart->hasHeaders() && curpart->Headers().HasContentType() ) {
       kdDebug(5006) << curpart->Headers().ContentType().TypeStr().c_str()
 		<< "  " << curpart->Headers().ContentType().SubtypeStr().c_str() << endl;
     }
 
     if (curpart &&
 	curpart->hasHeaders() &&
+        curpart->Headers().HasContentType() &&
 	curpart->Headers().ContentType().Type() == type &&
 	curpart->Headers().ContentType().Subtype() == subtype) {
 	part = curpart;
@@ -3818,13 +3819,15 @@
 //-----------------------------------------------------------------------------
 QCString KMMessage::charset() const
 {
-  DwMediaType &mType=mMsg->Headers().ContentType();
-  mType.Parse();
-  DwParameter *param=mType.FirstParameter();
-  while(param){
-    if (!kasciistricmp(param->Attribute().c_str(), "charset"))
-      return param->Value().c_str();
-    else param=param->Next();
+  if ( mMsg->Headers().HasContentType() ) {  
+    DwMediaType &mType=mMsg->Headers().ContentType();
+    mType.Parse();
+    DwParameter *param=mType.FirstParameter();
+    while(param){
+      if (!kasciistricmp(param->Attribute().c_str(), "charset"))
+        return param->Value().c_str();
+      else param=param->Next();
+    }
   }
   return ""; // us-ascii, but we don't have to specify it
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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