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

List:       kde-bugs-dist
Subject:    [Bug 72432] forwarding messages in imap folders with load on demand
From:       Carsten Burghardt <cb () magic-shop ! de>
Date:       2004-01-14 23:05:41
Message-ID: 20040114230541.24819.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
      
http://bugs.kde.org/show_bug.cgi?id=72432      
cb@magic-shop.de changed:

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



------- Additional Comments From cb@magic-shop.de  2004-01-15 00:05 -------
Subject: kdepim/kmail

CVS commit by burghard: 

Overriding the msgSize is no good for mbox. The msg was unGetted, the new msgbase \
inherits the msgsize and the next read in getMsg broke things. As the msgLength is \
not saved in the index I have to take a different approach to override LOD for small \
messages: after the header was downloaded we check the size again and then fall back \
to loading "TEXT".

CCMAIL: 72432-done@bugs.kde.org


  M +8 -0      imapaccountbase.cpp   1.37
  M +2 -1      imapjob.cpp   1.41
  M +1 -2      kmfolderimap.cpp   1.163


--- kdepim/kmail/imapaccountbase.cpp  #1.36:1.37
@@ -545,4 +545,12 @@ namespace KMail {
       return;
     }
+    // check the size, if the message is smaller than 5KB then load it in one go
+    if ( msg->msgLength() < 5000 )
+    {
+      FolderJob *job = msg->parent()->createJob(
+          msg, FolderJob::tGetMessage, 0, "TEXT" );
+      job->start();
+      return;
+    }
 
     // download parts according to attachmentstrategy

--- kdepim/kmail/imapjob.cpp  #1.40:1.41
@@ -302,5 +302,6 @@ void ImapJob::slotGetMessageResult( KIO:
         msg->fromByteArray( (*it).data );
         msg->setHeaderField("X-UID",uid);
-        msg->setMsgSize(size);
+        // set correct size
+        msg->setMsgLength(size);
         if ( mPartSpecifier.isEmpty() ) 
           msg->setComplete( true );

--- kdepim/kmail/kmfolderimap.cpp  #1.162:1.163
@@ -1029,5 +1029,5 @@ void KMFolderImap::slotGetMessagesData(K
       flagsToStatus((KMMsgBase*)msg, flags);
       // set the correct size
-      msg->setMsgSize( msg->headerField("X-Length").toUInt() );
+      msg->setMsgLength( msg->headerField("X-Length").toUInt() );
       close();
 
@@ -1051,5 +1051,4 @@ KMFolderImap::doCreateJob( KMMessage *ms
   if ( jt == FolderJob::tGetMessage && partSpecifier == "STRUCTURE" &&
        mAccount && mAccount->loadOnDemand() &&
-       ( msg->msgSize() > 5000 || msg->msgSize() < 600 ) && // the lower bound is \
for msgs with unknown total size  ( msg->signatureState() == KMMsgNotSigned || 
          msg->signatureState() == KMMsgSignatureStateUnknown ) )


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

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