From cc9b62f8d5462f6cdf1ac4093b1ecec8db1159ea Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 3 Sep 2008 20:13:12 +0000 Subject: [PATCH] Allow translating some of the filter critera for headers, namely subject, to, from and cc. I've left the other ones untouched as I think those a raw header fields and shouldn't be translated. Topic open for bikeshedding though :) BUG: 170033 svn path=/trunk/KDE/kdepim/; revision=856802 --- kmsearchpatternedit.cpp | 16 ++++++++++------ kmsearchpatternedit.h | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/kmsearchpatternedit.cpp b/kmsearchpatternedit.cpp index cec16d31a..4799fd55a 100644 --- a/kmsearchpatternedit.cpp +++ b/kmsearchpatternedit.cpp @@ -51,7 +51,11 @@ static const struct { { "", I18N_NOOP( "All Recipients" ) }, { "", I18N_NOOP( "Size in Bytes" ) }, { "", I18N_NOOP( "Age in Days" ) }, - { "", I18N_NOOP( "Message Status" ) } + { "", I18N_NOOP( "Message Status" ) }, + { "Subject", I18N_NOOP( "Subject" ) }, + { "From", I18N_NOOP( "From" ) }, + { "To", I18N_NOOP( "To" ) }, + { "CC", I18N_NOOP( "CC" ) } }; static const int SpecialRuleFieldsCount = sizeof( SpecialRuleFields ) / sizeof( *SpecialRuleFields ); @@ -264,13 +268,13 @@ void KMSearchRuleWidget::initFieldList( bool headersOnly, bool absoluteDates ) mFilterFieldList.append( i18n( SpecialRuleFields[Size].displayName ) ); if ( !absoluteDates ) mFilterFieldList.append( i18n( SpecialRuleFields[AgeInDays].displayName ) ); - mFilterFieldList.append( i18n( SpecialRuleFields[Status].displayName ) ); + mFilterFieldList.append( i18n( SpecialRuleFields[Subject].displayName ) ); + mFilterFieldList.append( i18n( SpecialRuleFields[From].displayName ) ); + mFilterFieldList.append( i18n( SpecialRuleFields[To].displayName ) ); + mFilterFieldList.append( i18n( SpecialRuleFields[CC].displayName ) ); + // these others only represent message headers and you can add to // them as you like - mFilterFieldList.append("Subject"); - mFilterFieldList.append("From"); - mFilterFieldList.append("To"); - mFilterFieldList.append("CC"); mFilterFieldList.append("Reply-To"); mFilterFieldList.append("List-Id"); mFilterFieldList.append("Organization"); diff --git a/kmsearchpatternedit.h b/kmsearchpatternedit.h index 88846ca9b..4df2b3a70 100644 --- a/kmsearchpatternedit.h +++ b/kmsearchpatternedit.h @@ -56,7 +56,8 @@ public: be used to initialize the widget. */ explicit KMSearchRuleWidget( QWidget* parent=0, KMSearchRule* aRule=0, bool headersOnly = false, bool absoluteDates = false ); - enum { Message, Body, AnyHeader, Recipients, Size, AgeInDays, Status }; + enum { Message, Body, AnyHeader, Recipients, Size, AgeInDays, Status, + Subject, From, To, CC }; /** Set whether only header fields can be searched. If @p is true only header fields can be searched otherwise \ and \ searches