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

List:       kde-commits
Subject:    kdepim/kmail
From:       Carsten Burghardt <cb () magic-shop ! de>
Date:       2003-12-31 16:10:28
Message-ID: 20031231161028.E7F3493EA () office ! kde ! org
[Download RAW message or body]

CVS commit by burghard: 

Load imap messages that are smaller than 5KB in one go even if lod is activated.
For these messages the additional server roundtrips slow things down. Nice side \
effect: the msg size is displayed correctly in the mimetree. Messages that are \
already in your folder will be loaded with lod the first time because the size is \
unknown. After that (and for all new messages) this should work as expected.
Happy New Year :-)


  M +2 -0      imapjob.cpp   1.36
  M +5 -2      kmfolderimap.cpp   1.161


--- kdepim/kmail/imapjob.cpp  #1.35:1.36
@@ -292,7 +292,9 @@ void ImapJob::slotGetMessageResult( KIO:
            mPartSpecifier == "HEADER" )
       {
+        uint size = msg->headerField("X-Length").toUInt();
         QString uid = msg->headerField("X-UID");
         msg->fromByteArray( (*it).data );
         msg->setHeaderField("X-UID",uid);
+        msg->setMsgSize(size);
         if ( mPartSpecifier.isEmpty() ) 
           msg->setComplete( TRUE );

--- kdepim/kmail/kmfolderimap.cpp  #1.160:1.161
@@ -1005,5 +1005,4 @@ void KMFolderImap::slotGetMessagesData(K
         // assign the sernum from the cache
         const ulong sernum = (ulong) uidmap[uid];
-//        kdDebug(5006) << "set sernum:" << sernum << " for " << uid << endl;
         msg->setMsgSerNum(sernum);
         // delete the entry
@@ -1024,4 +1023,6 @@ void KMFolderImap::slotGetMessagesData(K
       // Merge with the flags from the server.
       flagsToStatus((KMMsgBase*)msg, flags);
+      // set the correct size
+      msg->setMsgSize( msg->headerField("X-Length").toUInt() );
       close();
 
@@ -1045,8 +1046,10 @@ 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 ) )
   {
-    // retrieve the BODYSTRUCTURE and to speed things up also the headers
+    // load-on-demand: retrieve the BODYSTRUCTURE and to speed things up also the \
headers +    // this is not activated for small or signed messages
     ImapJob *job = new ImapJob( msg, jt, kmfi, "HEADER" );
     job->start();


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

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