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

List:       kmail-devel
Subject:    Kmail patch
From:       Laurent Montel <montel () kde ! org>
Date:       2003-08-17 17:28:44
[Download RAW message or body]

Hi,
This patch disable "Move all message to trash" when folder doesn't contain 
mail.
When there is not mail, this action is not necessary.

Regards.

["kmail-disable-move-to-trash.patch" (text/x-diff)]

cvs server: Diffing .
Index: kmfoldertree.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmfoldertree.cpp,v
retrieving revision 1.251
diff -u -u -p -r1.251 kmfoldertree.cpp
--- kmfoldertree.cpp	23 Jul 2003 21:54:13 -0000	1.251
+++ kmfoldertree.cpp	17 Aug 2003 17:23:24 -0000
@@ -981,10 +981,12 @@ void KMFolderTree::rightButtonPressed(QL
 
       folderMenu->insertSeparator();
 
-      folderMenu->insertItem(SmallIcon("edittrash"),
+      int idTrash = folderMenu->insertItem(SmallIcon("edittrash"),
         (kernel->folderIsTrash(fti->folder())) ? i18n("&Empty") :
                              i18n("&Move All Messages to Trash"), mMainWidget,
                              SLOT(slotEmptyFolder()));
+      if ( fti->folder() && !fti->folder()->noContent() )
+          folderMenu->setItemEnabled(idTrash, fti->folder()->count() > 0 );
     }
     if ( !fti->folder()->isSystemFolder() )
       folderMenu->insertItem(SmallIcon("editdelete"),
Index: kmmainwidget.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmmainwidget.cpp,v
retrieving revision 1.73
diff -u -u -p -r1.73 kmmainwidget.cpp
--- kmmainwidget.cpp	17 Aug 2003 15:55:16 -0000	1.73
+++ kmmainwidget.cpp	17 Aug 2003 17:23:24 -0000
@@ -240,8 +240,8 @@ void KMMainWidget::readConfig(void)
     // default width of the foldertree
     static const int folderpanewidth = 250;
 
-    const int folderW = config->readNumEntry( "FolderPaneWidth", folderpanewidth ); 
-    const int headerW = config->readNumEntry( "HeaderPaneWidth", width()-folderpanewidth ); 
+    const int folderW = config->readNumEntry( "FolderPaneWidth", folderpanewidth );
+    const int headerW = config->readNumEntry( "HeaderPaneWidth", width()-folderpanewidth );
     const int headerH = config->readNumEntry( "HeaderPaneHeight", 180 );
     const int readerH = config->readNumEntry( "ReaderPaneHeight", 280 );
 
@@ -876,7 +876,7 @@ void KMMainWidget::slotRemoveFolder()
                      "<b>%1</b> and all its subfolders, discarding their "
                      "contents?</qt>") .arg(mFolder->label());
       }
-  } 
+  }
 
   if (KMessageBox::warningContinueCancel(this, str, i18n("Delete Folder"),
                                          i18n("&Delete"))
@@ -2529,6 +2529,8 @@ void KMMainWidget::updateFolderMenu()
   emptyFolderAction->setEnabled( mFolder ? !mFolder->noContent() : false );
   emptyFolderAction->setText( (mFolder && kernel->folderIsTrash(mFolder))
     ? i18n("&Empty Trash") : i18n("&Move All Messages to Trash") );
+  if ( mFolder && !mFolder->noContent() )
+      emptyFolderAction->setEnabled( mFolder->count() > 0 );
   removeFolderAction->setEnabled( (mFolder && !mFolder->isSystemFolder()) );
   expireFolderAction->setEnabled( mFolder && mFolder->isAutoExpire() );
   markAllAsReadAction->setEnabled( mFolder && (mFolder->countUnread() > 0) );
cvs server: Diffing about
cvs server: Diffing interfaces
cvs server: Diffing pics
cvs server: Diffing profiles


_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.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