CVS commit by tilladam: More shuffling around of bits in the folder context menu. M +15 -13 kmfoldertree.cpp 1.345 --- kdepim/kmail/kmfoldertree.cpp #1.344:1.345 @@ -929,8 +929,12 @@ void KMFolderTree::slotContextMenuReques if (fti->folder()) folderMenu->insertTitle(fti->folder()->label()); + // outbox specific, but there it's the most used action + if ( (fti->folder() == kmkernel->outboxFolder()) && fti->folder()->count() ) + mMainWidget->action("send_queued")->plug( folderMenu ); // Mark all as read is supposedly used often, therefor it is first - if ( fti->folder() && !fti->folder()->noContent() ) + if ( fti->folder() && !fti->folder()->noContent() && fti->folder()->count() ) mMainWidget->action("mark_all_as_read")->plug( folderMenu ); + /* Treat the special case of the root and account folders */ if ((!fti->folder() || (fti->folder()->noContent() && !fti->parent()))) @@ -952,9 +956,8 @@ void KMFolderTree::slotContextMenuReques SLOT(slotCheckMail())); } - } else { - if ((fti->folder() == kmkernel->outboxFolder()) && (fti->folder()->count()) ) - mMainWidget->action("send_queued")->plug(folderMenu); - if (!fti->folder()->noChildren()) - { + } else { // regular folders + + folderMenu->insertSeparator(); + if ( !fti->folder()->noChildren() ) { folderMenu->insertItem(SmallIconSet("folder_new"), i18n("&New Subfolder..."), this, @@ -969,21 +972,20 @@ void KMFolderTree::slotContextMenuReques mMainWidget->action("search_messages")->plug(folderMenu); - mMainWidget->action("mark_all_as_read")->plug(folderMenu); - mMainWidget->action("compact")->plug(folderMenu); - folderMenu->insertSeparator(); - - mMainWidget->action("empty")->plug(folderMenu); - } if ( !fti->folder()->isSystemFolder() ) mMainWidget->action("delete_folder")->plug(folderMenu); + folderMenu->insertSeparator(); + mMainWidget->action("empty")->plug(folderMenu); + folderMenu->insertSeparator(); + } } + + /* plug in IMAP and DIMAP specific things */ if (fti->folder() && (fti->folder()->folderType() == KMFolderTypeImap || fti->folder()->folderType() == KMFolderTypeCachedImap )) { - folderMenu->insertSeparator(); folderMenu->insertItem(SmallIconSet("bookmark_folder"), i18n("Subscription..."), mMainWidget,