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

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim/kmail
From:       Will Stephenson <wstephenson () kde ! org>
Date:       2008-07-24 15:06:24
Message-ID: 1216911984.382200.32515.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 837390 by wstephens:

Write the id of the account used for the imap groupware resources; this
was apparently removed by accident during a proko2 merge back in
r346441 . The xml format still worked so the bug was not visible to
KDAB.  Fixed by integrating part of the old code that that commit
removed to identify the account from the folder.

(Backported to KDE 3 version of r837366)

BUG:150790


 M  +18 -0     configuredialog.cpp  


--- branches/KDE/3.5/kdepim/kmail/configuredialog.cpp #837389:837390
@@ -4985,6 +4985,24 @@
     KMFolder* folder = mFolderCombo->folder();
     if (  folder )
       folderId = folder->idString();
+    KMAccount* account = 0;
+    // Didn't find an easy way to find the account for a given folder...
+    // Fallback: iterate over accounts to select folderId if found (as an inbox folder)
+    for( KMAccount *a = kmkernel->acctMgr()->first();
+        a && !account; // stop when found
+        a = kmkernel->acctMgr()->next() ) {
+      if( a->folder() && a->folder()->child() ) {
+        KMFolderNode *node;
+        for ( node = a->folder()->child()->first(); node; node = a->folder()->child()->next() )
+        {
+          if ( static_cast<KMFolder*>(node) == folder ) {
+            account = a;
+            break;
+          }
+        }
+      }
+    }
+    GlobalSettings::self()->setTheIMAPResourceAccount( account ? account->id() : 0 );
   } else {
     // Inbox folder of the selected account
     KMAccount* acct = mAccountCombo->currentAccount();
[prev in list] [next in list] [prev in thread] [next in thread] 

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