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

List:       kde-pim
Subject:    [Kde-pim] kmail skip folder for unread search
From:       Scott Beck <sbeck () gossamer-threads ! com>
Date:       2005-05-29 7:15:41
Message-ID: 200505290015.41384.sbeck () gossamer-threads ! com
[Download RAW message or body]

Hi All,

This patch adds a folder option that allows the folder to be skipped when 
searching for the next unread message. This is useful for people that prefer 
to use next unread shortcut key in all folders but want to skip some folders 
(like spam and mailing lists they don't tend to read all the messages). Let 
me know what you think also let me know if I missed anything.

Cheers,

Scott

["kdepim-unread-skip.patch" (text/x-diff)]

Index: kmail/kmfolderdia.cpp
===================================================================
--- kmail/kmfolderdia.cpp	(revision 419304)
+++ kmail/kmfolderdia.cpp	(working copy)
@@ -336,6 +336,18 @@
         "is useful, for example, for ignoring spam folders." ) );
   hbl->addWidget( mNotifyOnNewMailCheckBox );
 
+  // should this folder be included in next unread message checks?
+  QHBoxLayout *urc = new QHBoxLayout( topLayout );
+  urc->setSpacing( KDialog::spacingHint() );
+  mUnreadMailCheckBox =
+    new QCheckBox( i18n("Include this folder when searching for unread messages" ), this );
+  QWhatsThis::add( mUnreadMailCheckBox,
+      i18n( "Check this option if you want to include this "
+        "folder when searching for the next unread message; unchecking this "
+        "is useful, for example, for ignoring spam folders when going to "
+        "the next unread message." ) );
+  urc->addWidget( mUnreadMailCheckBox );
+
   if ( mDlg->folder()->folderType() == KMFolderTypeImap ) {
     // should this folder be included in new-mail-checks?
 
@@ -502,6 +514,8 @@
   mIdentityComboBox->setCurrentIdentity( folder->identity() );
   // ignore new mail
   mNotifyOnNewMailCheckBox->setChecked( !folder->ignoreNewMail() );
+  // ignore unread
+  mUnreadMailCheckBox->setChecked( !folder->ignoreUnreadMail() );
 
   mKeepRepliesInSameFolderCheckBox->setChecked( folder->putRepliesInSameFolder() );
 
@@ -557,6 +571,7 @@
     folder->setUserWhoField(QString::null);
 
   folder->setIgnoreNewMail( !mNotifyOnNewMailCheckBox->isChecked() );
+  folder->setIgnoreUnreadMail( !mUnreadMailCheckBox->isChecked() );
   folder->setPutRepliesInSameFolder( mKeepRepliesInSameFolderCheckBox->isChecked() );
 
   QString fldName, oldFldName;
Index: kmail/kmfolder.h
===================================================================
--- kmail/kmfolder.h	(revision 419304)
+++ kmail/kmfolder.h	(working copy)
@@ -516,6 +516,13 @@
   bool ignoreNewMail() const { return mIgnoreNewMail; }
   void setIgnoreNewMail( bool b ) { mIgnoreNewMail = b; }
 
+  /**
+   * Returns true if the user doesn't want to include this folder in unread
+   * search.
+   */
+  bool ignoreUnreadMail() const { return mIgnoreUnreadMail; }
+  void setIgnoreUnreadMail( bool b ) { mIgnoreUnreadMail = b; }
+
   const KShortcut &shortcut() const { return mShortcut; }
   void setShortcut( const KShortcut& );
 
@@ -619,6 +626,8 @@
 
   /** Should new mail in this folder be ignored? */
   bool mIgnoreNewMail;
+  /** Should unread mail in this folder be ignored? (unread search) */
+  bool mIgnoreUnreadMail;
 
   /** shortcut associated with this folder or null, if none is configured. */
   KShortcut mShortcut;
Index: kmail/kmfolder.cpp
===================================================================
--- kmail/kmfolder.cpp	(revision 419304)
+++ kmail/kmfolder.cpp	(working copy)
@@ -141,6 +141,7 @@
     mId = savedId;
   mPutRepliesInSameFolder = config->readBoolEntry( "PutRepliesInSameFolder", false );
   mIgnoreNewMail = config->readBoolEntry( "IgnoreNewMail", false );
+  mIgnoreUnreadMail = config->readBoolEntry( "IgnoreUnreadMail", false );
 
   if ( mUseCustomIcons )
     emit iconsChanged();
@@ -176,6 +177,7 @@
   config->writeEntry("Id", mId);
   config->writeEntry( "PutRepliesInSameFolder", mPutRepliesInSameFolder );
   config->writeEntry( "IgnoreNewMail", mIgnoreNewMail );
+  config->writeEntry( "IgnoreUnreadMail", mIgnoreUnreadMail );
   if ( !mShortcut.isNull() )
     config->writeEntry( "Shortcut", mShortcut.toString() );
   else
Index: kmail/kmfolderdia.h
===================================================================
--- kmail/kmfolderdia.h	(revision 419304)
+++ kmail/kmfolderdia.h	(working copy)
@@ -140,6 +140,7 @@
   KIconButton *mUnreadIconButton;
   QCheckBox   *mIconsCheckBox;
   QCheckBox   *mNewMailCheckBox;
+  QCheckBox   *mUnreadMailCheckBox;
   QCheckBox   *mNotifyOnNewMailCheckBox;
   QCheckBox   *mKeepRepliesInSameFolderCheckBox;
   KLineEdit   *mNameEdit;
Index: kmail/kmfoldertree.cpp
===================================================================
--- kmail/kmfoldertree.cpp	(revision 419304)
+++ kmail/kmfoldertree.cpp	(working copy)
@@ -783,7 +783,7 @@
 //-----------------------------------------------------------------------------
 bool KMFolderTree::checkUnreadFolder (KMFolderTreeItem* fti, bool confirm)
 {
-  if (fti && fti->folder()  &&
+  if (fti && fti->folder()  && !fti->folder()->ignoreUnreadMail() &&
       (fti->folder()->countUnread() > 0)) {
 
     // Don't change into the trash or outbox folders.


_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

Configure | About | News | Add a list | Sponsored by KoreLogic