Fix <To or CC> equals ... (previously it didn\'t work due to To and Cc being

simply concatenated. Now we try them each in turn. Patch by David Faure.

svn path=/trunk/kdenetwork/kmail/; revision=105809
wilder-work
Marc Mutz 25 years ago
parent e2b8e51940
commit d1a8ea5259
  1. 10
      kmsearchpattern.cpp
  2. 2
      kmsearchpattern.h

@ -108,9 +108,8 @@ bool KMSearchRule::matches(const KMMessage* msg) const
} else if( mField == "<any header>" ) {
msgContents = msg->headerAsString();
} else if( mField == "<To or Cc>" ) {
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 == "<size>" ) {
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)
{

@ -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;

Loading…
Cancel
Save