Implement "Exclude important messages from expiry" config option and gui

for it.

Andrew, thanks for your patch. I've had to adjust things to the changes
in status handling and add the config stuff, but it's still appreciated.

CCMAIL: 37419-done@bugs.kde.org

svn path=/trunk/kdepim/; revision=290257
wilder-work
Till Adam 22 years ago
parent ddcf2c26f2
commit 6d748d9f4f
  1. 9
      configuredialog.cpp
  2. 1
      configuredialog_p.h
  3. 5
      kmail.kcfg
  4. 5
      maildirjob.cpp
  5. 6
      mboxjob.cpp

@ -3689,6 +3689,12 @@ MiscPageFolderTab::MiscPageFolderTab( QWidget * parent, const char * name )
vlay->addWidget( mWarnBeforeExpire );
connect( mWarnBeforeExpire, SIGNAL( stateChanged( int ) ),
this, SLOT( slotEmitChanged( void ) ) );
mExcludeImportantFromExpiry =
new QCheckBox( i18n("E&xclude important messages from expiry"), this );
vlay->addWidget( mExcludeImportantFromExpiry );
connect( mExcludeImportantFromExpiry, SIGNAL( stateChanged( int ) ),
this, SLOT( slotEmitChanged( void ) ) );
// "when trying to find unread messages" combo + label: stretch 0
hlay = new QHBoxLayout( vlay ); // inherits spacing
mLoopOnGotoUnread = new QComboBox( false, this );
@ -3823,6 +3829,7 @@ void MiscPage::FolderTab::load() {
mEmptyTrashCheck->setChecked( general.readBoolEntry( "empty-trash-on-exit", true ) );
mExpireAtExit->setChecked( general.readNumEntry( "when-to-expire", 0 ) ); // set if non-zero
mWarnBeforeExpire->setChecked( general.readBoolEntry( "warn-before-expire", true ) );
mExcludeImportantFromExpiry->setChecked( GlobalSettings::excludeImportantMailFromExpiry() );
mOnStartupOpenFolder->setFolder( general.readEntry( "startupFolder",
kmkernel->inboxFolder()->idString() ) );
mCompactOnExitCheck->setChecked( general.readBoolEntry( "compact-all-on-exit", true ) );
@ -3856,6 +3863,8 @@ void MiscPage::FolderTab::save() {
GlobalSettings::setJumpToUnread( mJumpToUnread->isChecked() );
GlobalSettings::setLoopOnGotoUnread( mLoopOnGotoUnread->currentItem() );
GlobalSettings::setShowPopupAfterDnD( mShowPopupAfterDnD->isChecked() );
GlobalSettings::setExcludeImportantMailFromExpiry(
mExcludeImportantFromExpiry->isChecked() );
if ( mExpireAtExit->isChecked() )
general.writeEntry( "when-to-expire", expireAtExit );

@ -766,6 +766,7 @@ public:
protected:
QCheckBox *mEmptyFolderConfirmCheck;
QCheckBox *mWarnBeforeExpire;
QCheckBox *mExcludeImportantFromExpiry;
QComboBox *mLoopOnGotoUnread;
QCheckBox *mJumpToUnread;
QComboBox *mMailboxPrefCombo;

@ -33,5 +33,10 @@
<whatsthis> </whatsthis>
<default>true</default>
</entry>
<entry name="ExcludeImportantMailFromExpiry" type="Bool">
<label></label>
<whatsthis></whatsthis>
<default>true</default>
</entry>
</group>
</kcfg>

@ -35,6 +35,7 @@
#include "kmfoldermaildir.h"
#include "kmfolder.h"
#include "globalsettings.h"
#include <kapplication.h>
#include <kdebug.h>
@ -153,6 +154,10 @@ MaildirJob::expireMessages()
if (mb == 0) {
continue;
}
if ( mb->isImportant()
&& GlobalSettings::excludeImportantMailFromExpiry() )
continue;
msgTime = mb->date();
if (mb->isUnread()) {

@ -36,6 +36,7 @@
#include "kmfoldermbox.h"
#include "kmfolder.h"
#include "globalsettings.h"
#include <kapplication.h>
#include <kdebug.h>
@ -105,6 +106,11 @@ MboxJob::expireMessages()
if (mb == 0) {
continue;
}
if ( mb->isImportant()
&& GlobalSettings::excludeImportantMailFromExpiry() )
continue;
msgTime = mb->date();
if (mb->isUnread()) {

Loading…
Cancel
Save