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

List:       kmail-devel
Subject:    [Bug 60516] KMail Cached IMAP Subscription Bug
From:       Carsten Burghardt <cb () magic-shop ! de>
Date:       2003-07-31 19:37:17
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=60516     
cb@magic-shop.de changed:

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



------- Additional Comments From cb@magic-shop.de  2003-07-31 21:37 -------
Subject: kdepim/kmail

CVS commit by burghard: 

Fix loop with courier and personal namespace.
CCMAIL: 60516-done@bugs.kde.org


  M +27 -23    subscriptiondialog.cpp   1.7


--- kdepim/kmail/subscriptiondialog.cpp  #1.6:1.7
@@ -55,4 +55,5 @@ void SubscriptionDialog::slotListDirecto
   GroupItem *parent = 0;
   mLoading = true;
+  ImapAccountBase* ai = static_cast<ImapAccountBase*>(mAcct);
 
   if (!onlySubscribed)
@@ -86,16 +87,18 @@ void SubscriptionDialog::slotListDirecto
     {
       bool create = true;
-      if (parent)
+      QListViewItem *start = folderTree()->firstChild();
+      if ( parent )
+        start = parent->firstChild();
+      if ( start )
       {
-        for ( QListViewItem *it = parent->firstChild() ;
-            it ; it = it->nextSibling() )
+        for ( QListViewItem *it = start; it; it = it->nextSibling() )
         {
           // check if this item already exists in this hierarchy
           item = static_cast<GroupItem*>(it);
-          if (item->info().path == mSubfolderPaths[i])
+          if ( item->info().path == mSubfolderPaths[i] )
             create = false;
         }
       }
-      if (create)
+      if ( create )
       {
         KGroupInfo info(mSubfolderNames[i]);
@@ -110,10 +113,9 @@ void SubscriptionDialog::slotListDirecto
           item = new GroupItem(folderTree(), info, this, true);
       }
-      if (item)
-      {
-        // reset
+      if ( item ) // reset
         item->setOn(false);
-      }
-    } else {
+
+    } else 
+    {
       // find the item
       QListViewItemIterator it( groupView );
@@ -129,18 +131,17 @@ void SubscriptionDialog::slotListDirecto
       }
     }
-    if (mSubfolderMimeTypes[i] == "message/directory" ||
-        mSubfolderMimeTypes[i] == "inode/directory")
+    if ( mSubfolderMimeTypes[i] == "message/directory" ||
+         mSubfolderMimeTypes[i] == "inode/directory" )
     {
       // descend
-      static_cast<ImapAccountBase*>(mAcct)->listDirectory(mSubfolderPaths[i],
-          onlySubscribed);
+      bool secondStep = (mSubfolderPaths[i] == ai->prefix()) ? true : false;
+      static_cast<ImapAccountBase*>(mAcct)->listDirectory( mSubfolderPaths[i],
+          onlySubscribed, secondStep );
     }
   }
-  if (jobData.inboxOnly)
-  {
-    ImapAccountBase* ai = static_cast<ImapAccountBase*>(mAcct);
-    ai->listDirectory(ai->prefix(), false, true);
-    ai->listDirectory(ai->prefix(), true, true);
-  }
+  if ( jobData.inboxOnly )
+    ai->listDirectory( ai->prefix(), onlySubscribed, true );
+  
+  // active buttons and stuff
   slotLoadingComplete();
 }
@@ -171,11 +172,14 @@ void SubscriptionDialog::slotSave()
 void SubscriptionDialog::slotLoadFolders()
 {
+  // clear the views
   KSubscription::slotLoadFolders();
-  if ( !account())
+  if ( !account() )
     return;
   ImapAccountBase* ai = static_cast<ImapAccountBase*>(account());
+  if ( ai->prefix().isEmpty() )
+    return;
   // get folders
-  ai->listDirectory(ai->prefix(), false);
-  ai->listDirectory(ai->prefix(), true);
+  ai->listDirectory( ai->prefix(), false );
+  ai->listDirectory( ai->prefix(), true );
 }
_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread] 

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