diff options
Diffstat (limited to 'kmail/kmsearchpattern.cpp')
-rw-r--r-- | kmail/kmsearchpattern.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/kmail/kmsearchpattern.cpp b/kmail/kmsearchpattern.cpp index 4c4340a2b..1d6fd95d7 100644 --- a/kmail/kmsearchpattern.cpp +++ b/kmail/kmsearchpattern.cpp @@ -41,7 +41,7 @@ static const int numFuncConfigNames = sizeof funcConfigNames / sizeof *funcConfi struct _statusNames { const char* name; - KMMsgtqStatus status; + KMMsgStatus status; }; static struct _statusNames statusNames[] = { @@ -104,7 +104,7 @@ KMSearchRule * KMSearchRule::createInstance( const TQCString & field, { KMSearchRule *ret = 0; if (field == "<status>") - ret = new KMSearchRuletqStatus( field, func, contents ); + ret = new KMSearchRuleStatus( field, func, contents ); else if ( field == "<age in days>" || field == "<size>" ) ret = new KMSearchRuleNumerical( field, func, contents ); else @@ -550,7 +550,7 @@ bool KMSearchRuleNumerical::matches( const KMMessage * msg ) const } else if ( field() == "<age in days>" ) { TQDateTime msgDateTime; msgDateTime.setTime_t( msg->date() ); - numericalMsgContents = msgDateTime.daysTo( TQDateTime::tqcurrentDateTime() ); + numericalMsgContents = msgDateTime.daysTo( TQDateTime::currentDateTime() ); numericalValue = contents().toInt(); msgContents.setNum( numericalMsgContents ); } @@ -622,10 +622,10 @@ bool KMSearchRuleNumerical::matchesInternal( long numericalValue, //================================================== // -// class KMSearchRuletqStatus +// class KMSearchRuleStatus // //================================================== -TQString englishNameFortqStatus( const KMMsgtqStatus& status ) +TQString englishNameForStatus( const KMMsgStatus& status ) { for ( int i=0; i< numStatusNames; i++ ) { if ( statusNames[i].status == status ) { @@ -635,22 +635,22 @@ TQString englishNameFortqStatus( const KMMsgtqStatus& status ) return TQString(); } -KMSearchRuletqStatus::KMSearchRuletqStatus( const TQCString & field, +KMSearchRuleStatus::KMSearchRuleStatus( const TQCString & field, Function func, const TQString & aContents ) : KMSearchRule(field, func, aContents) { // the values are always in english, both from the conf file as well as // the patternedit gui - mtqStatus = statusFromEnglishName( aContents ); + mStatus = statusFromEnglishName( aContents ); } -KMSearchRuletqStatus::KMSearchRuletqStatus( int status, Function func ) -: KMSearchRule( "<status>", func, englishNameFortqStatus( status ) ) +KMSearchRuleStatus::KMSearchRuleStatus( int status, Function func ) +: KMSearchRule( "<status>", func, englishNameForStatus( status ) ) { - mtqStatus = status; + mStatus = status; } -KMMsgtqStatus KMSearchRuletqStatus::statusFromEnglishName( const TQString & aStatusString ) +KMMsgStatus KMSearchRuleStatus::statusFromEnglishName( const TQString & aStatusString ) { for ( int i=0; i< numStatusNames; i++ ) { if ( !aStatusString.compare( statusNames[i].name ) ) { @@ -660,33 +660,33 @@ KMMsgtqStatus KMSearchRuletqStatus::statusFromEnglishName( const TQString & aSta return KMMsgStatusUnknown; } -bool KMSearchRuletqStatus::isEmpty() const +bool KMSearchRuleStatus::isEmpty() const { return field().stripWhiteSpace().isEmpty() || contents().isEmpty(); } -bool KMSearchRuletqStatus::matches( const DwString &, KMMessage &, +bool KMSearchRuleStatus::matches( const DwString &, KMMessage &, const DwBoyerMoore *, int ) const { assert( 0 ); return false; // don't warn } -bool KMSearchRuletqStatus::matches( const KMMessage * msg ) const +bool KMSearchRuleStatus::matches( const KMMessage * msg ) const { - KMMsgtqStatus msgtqStatus = msg->status(); + KMMsgStatus msgStatus = msg->status(); bool rc = false; switch ( function() ) { case FuncEquals: // fallthrough. So that "<status> 'is' 'read'" works case FuncContains: - if (msgtqStatus & mtqStatus) + if (msgStatus & mStatus) rc = true; break; case FuncNotEqual: // fallthrough. So that "<status> 'is not' 'read'" works case FuncContainsNot: - if (! (msgtqStatus & mtqStatus) ) + if (! (msgStatus & mStatus) ) rc = true; break; // FIXME what about the remaining funcs, how can they make sense for |