summaryrefslogtreecommitdiffstats
path: root/kmail/favoritefolderview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /kmail/favoritefolderview.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/favoritefolderview.cpp')
-rw-r--r--kmail/favoritefolderview.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/kmail/favoritefolderview.cpp b/kmail/favoritefolderview.cpp
index 35b2e3ee4..5d8e3d13a 100644
--- a/kmail/favoritefolderview.cpp
+++ b/kmail/favoritefolderview.cpp
@@ -309,7 +309,8 @@ void FavoriteFolderView::dropped(TQDropEvent * e, TQListViewItem * after)
KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() );
if ( !fti->folder() )
continue;
- afterItem = addFolder( fti->folder(), prettyName( fti ), afterItem );
+ if( !mFolderToItem.contains( fti->folder() ) )
+ afterItem = addFolder( fti->folder(), prettyName( fti ), afterItem );
}
e->accept();
}
@@ -323,20 +324,25 @@ void FavoriteFolderView::contextMenu(TQListViewItem * item, const TQPoint & poin
mContextMenuItem = fti;
KPopupMenu contextMenu;
if ( fti && fti->folder() ) {
- contextMenu.insertItem( SmallIconSet("editdelete"), i18n("Remove From Favorites"),
- this, TQT_SLOT(removeFolder()) );
- contextMenu.insertItem( SmallIconSet("edit"), i18n("Rename Favorite"), this, TQT_SLOT(renameFolder()) );
- contextMenu.insertSeparator();
-
mainWidget()->action("mark_all_as_read")->plug( &contextMenu );
if ( fti->folder()->folderType() == KMFolderTypeImap || fti->folder()->folderType() == KMFolderTypeCachedImap )
mainWidget()->action("refresh_folder")->plug( &contextMenu );
if ( fti->folder()->isMailingListEnabled() )
mainWidget()->action("post_message")->plug( &contextMenu );
+ mainWidget()->action("search_messages")->plug( &contextMenu );
+ if ( fti->folder()->canDeleteMessages() && ( fti->folder()->count() > 0 ) )
+ mainWidget()->action("empty")->plug( &contextMenu );
+ contextMenu.insertSeparator();
contextMenu.insertItem( SmallIconSet("configure_shortcuts"), i18n("&Assign Shortcut..."), fti, TQT_SLOT(assignShortcut()) );
contextMenu.insertItem( i18n("Expire..."), fti, TQT_SLOT(slotShowExpiryProperties()) );
mainWidget()->action("modify")->plug( &contextMenu );
+ contextMenu.insertSeparator();
+
+ contextMenu.insertItem( SmallIconSet("editdelete"), i18n("Remove From Favorites"),
+ this, TQT_SLOT(removeFolder()) );
+ contextMenu.insertItem( SmallIconSet("edit"), i18n("Rename Favorite"), this, TQT_SLOT(renameFolder()) );
+
} else {
contextMenu.insertItem( SmallIconSet("bookmark_add"), i18n("Add Favorite Folder..."),
this, TQT_SLOT(addFolder()) );
@@ -346,8 +352,13 @@ void FavoriteFolderView::contextMenu(TQListViewItem * item, const TQPoint & poin
void FavoriteFolderView::removeFolder()
{
+ KMFolderTreeItem *fti = mContextMenuItem;
+ KMFolder *folder = 0;
+ if( fti )
+ folder = fti->folder();
delete mContextMenuItem;
mContextMenuItem = 0;
+ removeFromFolderToItemMap(folder);
notifyInstancesOnChange();
}
@@ -446,6 +457,9 @@ void FavoriteFolderView::addFolder()
KMFolder *folder = dlg.folder();
if ( !folder )
return;
+ if ( mFolderToItem.contains( folder ) )
+ return;
+
KMFolderTreeItem *fti = findFolderTreeItem( folder );
addFolder( folder, fti ? prettyName( fti ) : folder->label() );
}
@@ -454,7 +468,8 @@ void KMail::FavoriteFolderView::addFolder(KMFolderTreeItem * fti)
{
if ( !fti || !fti->folder() )
return;
- addFolder( fti->folder(), prettyName( fti ) );
+ if ( !mFolderToItem.contains( fti->folder() ) )
+ addFolder( fti->folder(), prettyName( fti ) );
}
KMFolderTreeItem * FavoriteFolderView::findFolderTreeItem(KMFolder * folder) const
@@ -485,7 +500,7 @@ void FavoriteFolderView::checkMail()
imap->getAndCheckFolder();
} else if ( fti->folder()->folderType() == KMFolderTypeCachedImap ) {
KMFolderCachedImap* f = static_cast<KMFolderCachedImap*>( fti->folder()->storage() );
- f->account()->processNewMailSingleFolder( fti->folder() );
+ f->account()->processNewMailInFolder( fti->folder() );
}
}
}