diff --git a/filterlog.cpp b/filterlog.cpp index 01082932f..94e2e29fd 100644 --- a/filterlog.cpp +++ b/filterlog.cpp @@ -57,11 +57,6 @@ void FilterLog::add( QString logEntry ) { logEntries.append( logEntry ); emit logEntryAdded( logEntry ); -// FIXME to be removed -#ifndef NDEBUG - //if ( !(logEntries.size() % 10) ) - // dump(); -#endif } } diff --git a/filterlogdlg.cpp b/filterlogdlg.cpp index 83c8dbc03..c2bb58d96 100644 --- a/filterlogdlg.cpp +++ b/filterlogdlg.cpp @@ -41,8 +41,8 @@ using namespace KMail; FilterLogDialog::FilterLogDialog( QWidget * parent ) -: KDialogBase(parent, "FilterLogDlg", false, i18n( "KMail Filter Log Viewer" ), - Close, Close ) +: KDialogBase( parent, "FilterLogDlg", false, i18n( "KMail Filter Log Viewer" ), + User1|Close, Close, true, i18n("C&lear") ) { textEdit = new KTextEdit( this ); setMainWidget( textEdit ); @@ -68,4 +68,11 @@ void FilterLogDialog::slotLogEntryAdded( QString logEntry ) } +void FilterLogDialog::slotUser1() +{ + FilterLog::instance()->clear(); + textEdit->clear(); +} + + #include "filterlogdlg.moc" diff --git a/filterlogdlg.h b/filterlogdlg.h index 9dbf4e0c7..de4571dab 100644 --- a/filterlogdlg.h +++ b/filterlogdlg.h @@ -54,6 +54,7 @@ namespace KMail { void slotLogEntryAdded( QString logEntry ); protected: + virtual void slotUser1(); KTextEdit * textEdit; }; diff --git a/kmfiltermgr.cpp b/kmfiltermgr.cpp index f522aaf4d..e8ee0a169 100644 --- a/kmfiltermgr.cpp +++ b/kmfiltermgr.cpp @@ -135,6 +135,9 @@ bool KMFilterMgr::beginFiltering(KMMsgBase *msgBase) const return false; MessageProperty::setFiltering( msgBase, true ); MessageProperty::setFilterFolder( msgBase, 0 ); + if ( FilterLog::instance()->isLogging() ) { + FilterLog::instance()->add( "------------------------------" ); + } return true; } @@ -207,14 +210,14 @@ int KMFilterMgr::process( KMMessage * msg, FilterSet set ) { // filter is applicable if ( FilterLog::instance()->isLogging() ) { - QString logText( i18n( "Evaluating filter rule: " ) ); + QString logText( i18n( "Evaluating filter rules:\n" ) ); logText.append( (*it)->pattern()->asString() ); FilterLog::instance()->add( logText ); } if ( (*it)->pattern()->matches( msg ) ) { // filter matches if ( FilterLog::instance()->isLogging() ) - FilterLog::instance()->add( i18n( "Filter rule has matched." ) ); + FilterLog::instance()->add( i18n( "Filter rules have matched." ) ); // execute actions: if ( (*it)->execActions(msg, stopIt) == KMFilter::CriticalError ) return 2; diff --git a/kmsearchpattern.cpp b/kmsearchpattern.cpp index 34e4fb847..afce15fc9 100644 --- a/kmsearchpattern.cpp +++ b/kmsearchpattern.cpp @@ -699,9 +699,11 @@ void KMSearchPattern::init() { } QString KMSearchPattern::asString() const { - QString result = "(match "; - result += ( mOperator == OpOr ) ? "any" : "all"; - result += " of the following)\n"; + QString result = "\t"; + if ( mOperator == OpOr ) + result += i18n("(match any of the following)") + "\n"; + else + result += i18n("(match all of the following)") + "\n"; for ( QPtrListIterator it( *this ) ; it.current() ; ++it ) result += (*it)->asString() + '\n';