[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-07-31 19:37:12
[Download RAW message or body]
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 );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic