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

List:       kde-core-devel
Subject:    You can turn threading on now :-)
From:       Don Sanders <sanders () kde ! org>
Date:       2000-10-13 15:19:18
[Download RAW message or body]

Here is a patch fastthreading.diff people might like to test, it speeds up 
threading especially for large folders (5000+ mails)

My bugs folder with 9000 mails in it now takes 5 seconds instead of 42 
seconds (qt, kdelibs, kdenetwork all built with debugging enabled and 
optimization turned off so it could be faster). I guess a speedup this big is 
a bug fix.

Actually the threading speedup is just a one liner.

diff -u -b -r1.210 kmheaders.cpp
--- kmheaders.cpp       2000/10/07 20:23:59     1.210
+++ kmheaders.cpp       2000/10/13 15:05:00
@@ -1675,7 +1681,7 @@
     recursivelyAddChildren( *it, hi );
   }
 
-  setOpen( parent, true );
+  parent->setOpen( true );
 }


I also include some other changes in the hope that people will test them:
fasthreading.diff
  Fix a problem for people upgrading from KMail 1.0.x, some people weren't
   able to change the sort order of columns in the message list.
  Fix a problem introduce by the emptypool.diff patch, when the selected
    folder was empty and a new mail arrived in it. (KMail would crash)

emptypool.diff
  Fixes a memory leak, when retrieving mail from a pop account.
  Fixes a (probably harmless) problem with a timer going off unnecessarily
    when mail was checked and no mail was found on the server.

BFN,
Don.
                                                  
["fastthreading.diff" (text/plain)]

Index: kmheaders.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmheaders.cpp,v
retrieving revision 1.210
diff -u -b -r1.210 kmheaders.cpp
--- kmheaders.cpp	2000/10/07 20:23:59	1.210
+++ kmheaders.cpp	2000/10/13 14:58:07
@@ -471,6 +471,8 @@
 
   mSortCol = config->readNumEntry("SortColumn", (int)KMMsgList::sfDate);
   mSortDescending = (mSortCol < 0);
+  if (mSortCol == 0)
+      mSortCol = 3;
   mSortCol = abs(mSortCol) - 1;
 
   mTopItem = config->readNumEntry("Top", 0);
@@ -720,13 +722,17 @@
   mItems[id] = hi;
   msgHeaderChanged(id);
 
-  if ((childCount() == 1) && hi) {
-    setSelected( hi, true );
-    highlightMessage( hi );
-  }
+  if ((childCount() == 1) && hi)
+      QTimer::singleShot( 0, this, SLOT( firstMsgArrived() ) );
 }
 
 
+void KMHeaders::firstMsgArrived()
+{
+    if (!currentItem())
+    setCurrentItem( firstChild() );
+}
+
 //-----------------------------------------------------------------------------
 void KMHeaders::msgRemoved(int id, QString msgId)
 {
@@ -1675,7 +1681,7 @@
     recursivelyAddChildren( *it, hi );
   }
 
-  setOpen( parent, true );
+  parent->setOpen( true );
 }
 
 
Index: kmheaders.h
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmheaders.h,v
retrieving revision 1.59
diff -u -b -r1.59 kmheaders.h
--- kmheaders.h	2000/08/14 00:14:58	1.59
+++ kmheaders.h	2000/10/13 14:58:07
@@ -154,6 +154,8 @@
 public slots:
   void workAroundQListViewLimitation();
 
+  // If there is not currentItem then select the first item in the list
+  void firstMsgArrived();
   // For when a list view item has been double clicked
   void selectMessage(QListViewItem*);
   // For nested message view, recusively add all children of a message

["emptypool.diff" (text/x-c++)]

Index: kmacctexppop.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmacctexppop.cpp,v
retrieving revision 1.40
diff -u -b -r1.40 kmacctexppop.cpp
--- kmacctexppop.cpp	2000/09/28 10:22:30	1.40
+++ kmacctexppop.cpp	2000/10/11 23:12:24
@@ -437,13 +437,11 @@
     // -sanders Update processNewMsg should no longer process events
 
     addedOk = processNewMsg(*cur); //added ok? Error displayed if not.
-    /*
     if ((*cur)->parent()) {
       int count = (*cur)->parent()->count();
       if ((*cur)->parent()->operator[](count - 1) == *cur)
 	(*cur)->parent()->unGetMsg(count - 1);
     }
-    */
 
     if (!addedOk) {
       idsOfMsgsPendingDownload.clear();
@@ -553,9 +551,8 @@
     kdDebug() << "stage == Uidl" << endl;
     stage = Retr;
     numMsgs = idsOfMsgsPendingDownload.count();
-    slotGetNextMsg();
     processMsgsTimer.start(processingDelay);
-
+    slotGetNextMsg();
   }
   else if (stage == Retr) {
     kdDebug() << "stage == Retr" << endl;
Index: kmaccount.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmaccount.cpp,v
retrieving revision 1.41
diff -u -b -r1.41 kmaccount.cpp
--- kmaccount.cpp	2000/10/07 20:23:59	1.41
+++ kmaccount.cpp	2000/10/11 23:12:24
@@ -175,6 +175,7 @@
   }
   else if (processResult == 1)
   {
+    kernel->filterMgr()->tempOpenFolder(mFolder);
     rc = mFolder->addMsg(aMsg);
     if (rc) {
       perror("failed to add message");


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

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