diff --git a/kmsearchpattern.cpp b/kmsearchpattern.cpp index 478259ea3..67c97f646 100644 --- a/kmsearchpattern.cpp +++ b/kmsearchpattern.cpp @@ -108,9 +108,8 @@ bool KMSearchRule::matches(const KMMessage* msg) const } else if( mField == "" ) { msgContents = msg->headerAsString(); } else if( mField == "" ) { - msgContents = msg->headerField("To"); - msgContents += "\n"; - msgContents += msg->headerField("Cc"); + return matches( false, 0, 0, msg->headerField("To") ) + || matches( false, 0, 0, msg->headerField("Cc") ); } else if( mField == "" ) { numerical = TRUE; numericalMsgContents = msg->msgSize(); @@ -127,6 +126,11 @@ bool KMSearchRule::matches(const KMMessage* msg) const msgContents = msg->headerField(mField); } + return matches( numerical, numericalValue, numericalMsgContents, msgContents ); +} + +bool KMSearchRule::matches( bool numerical, unsigned long numericalValue, unsigned long numericalMsgContents, QString msgContents ) const +{ // also see KMFldSearchRule::matches() for a similar function: switch (mFunction) { diff --git a/kmsearchpattern.h b/kmsearchpattern.h index 4a53246b9..5895e8601 100644 --- a/kmsearchpattern.h +++ b/kmsearchpattern.h @@ -118,6 +118,8 @@ public: const QString asString() const; protected: + /** Helper for the main matches() method */ + bool matches( bool numerical, unsigned long numericalValue, unsigned long numericalMsgContents, QString msgContents ) const; QCString mField; Function mFunction; QString mContents;