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

List:       kmail-devel
Subject:    Patch for "Empty trash on local mail" menu item
From:       Heiko Nardmann <h.nardmann () secunet ! de>
Date:       2001-02-26 14:16:49
[Download RAW message or body]

Here is a patch to provide a menu item "&Empty trash on local mail".
This patch is based on KMail 1.1.99 (KDE 2.0.1).

Could someone review it to tell me what is missing (especially concerning the 
interaction between the call from the menu and the update of the GUI before, 
during and after the action) ?

-- 
Heiko Nardmann (Dipl.-Ing.), h.nardmann@secunet.de, Software Development
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax  : +49 271 48950-50

["kmmainwin.h.diff" (text/plain)]

--- kmmainwin.h.orig	Mon Feb 26 15:07:36 2001
+++ kmmainwin.h	Mon Feb 26 14:59:53 2001
@@ -116,6 +116,7 @@
   void slotCompose();
   void slotModifyFolder();
   void slotRemoveFolder();
+  void slotEmptyTrash();
   void slotEmptyFolder();
   void slotCompactFolder();
   void slotOverrideHtml();

["kmmainwin.cpp.diff" (text/plain)]

--- kmmainwin.cpp.orig	Thu Feb  8 10:02:59 2001
+++ kmmainwin.cpp	Mon Feb 26 15:12:44 2001
@@ -662,6 +662,28 @@
 
 
 //-----------------------------------------------------------------------------
+void KMMainWin::slotEmptyTrash()
+{
+  kernel->kbp()->busy();
+
+  mMsgView->clearCache();
+
+  if (mFolder)
+  {
+    if (mFolder == kernel->trashFolder())
+    {
+      mMsgView->clearCache();
+
+      mMsgView->clear();
+    }
+  }
+
+  kernel->trashFolder()->expunge();
+
+  kernel->kbp()->idle();
+}
+
+//-----------------------------------------------------------------------------
 void KMMainWin::slotEmptyFolder()
 {
   QString str;
@@ -1277,6 +1299,10 @@
     this, SLOT(slotSaveMsg()), actionCollection(), "save_as" );
 
   KStdAction::print (this, SLOT(slotPrintMsg()), actionCollection());
+
+  (void) new KAction( i18n("&Empty trash on local mail"), 0,
+		      this, SLOT(slotEmptyTrash()),
+		      actionCollection(), "empty_trash" );
 
   (void) new KAction( i18n("Compact all &folders"), 0,
 		      kernel->folderMgr(), SLOT(compactAll()),

["kmmainwin.rc.diff" (text/plain)]

--- kmmainwin.rc.orig	Mon Feb 26 14:15:09 2001
+++ kmmainwin.rc	Mon Feb 26 14:16:41 2001
@@ -7,6 +7,7 @@
    <Action name="save_as" />
    <Action name="file_print" />
    <Separator/>
+   <Action name="empty_trash" />
    <Action name="compact_all_folders" />
    <Separator/>
    <Action name="check_mail" />

_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.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