summaryrefslogtreecommitdiffstats
path: root/kmail/kmsearchpattern.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmsearchpattern.cpp')
-rw-r--r--kmail/kmsearchpattern.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/kmail/kmsearchpattern.cpp b/kmail/kmsearchpattern.cpp
index dc2cc4a1c..4af3d68a0 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;
- KMMsgStatus status;
+ KMMsgtqStatus status;
};
static struct _statusNames statusNames[] = {
@@ -104,7 +104,7 @@ KMSearchRule * KMSearchRule::createInstance( const TQCString & field,
{
KMSearchRule *ret = 0;
if (field == "<status>")
- ret = new KMSearchRuleStatus( field, func, contents );
+ ret = new KMSearchRuletqStatus( field, func, contents );
else if ( field == "<age in days>" || field == "<size>" )
ret = new KMSearchRuleNumerical( field, func, contents );
else
@@ -281,10 +281,10 @@ bool KMSearchRuleString::matches( const DwString & aStr, KMMessage & msg,
rc = ( ( function() & 1 ) == 1 );
else {
start += headerLen;
- size_t stop = aStr.find( '\n', start );
+ size_t stop = aStr.tqfind( '\n', start );
char ch = '\0';
while ( stop != DwString::npos && ( ( ch = aStr.at( stop + 1 ) ) == ' ' || ch == '\t' ) )
- stop = aStr.find( '\n', stop + 1 );
+ stop = aStr.tqfind( '\n', stop + 1 );
const int len = stop == DwString::npos ? aStr.length() - start : stop - start ;
const TQCString codedValue( aStr.data() + start, len + 1 );
const TQString msgContents = KMMsgBase::decodeRFC2047String( codedValue ).stripWhiteSpace(); // FIXME: This needs to be changed for IDN support.
@@ -357,7 +357,7 @@ bool KMSearchRuleString::matches( const KMMessage * msg ) const
msgContents = msg->headerAsString();
logContents = false;
} else if ( field() == "<recipients>" ) {
- // (mmutz 2001-11-05) hack to fix "<recipients> !tqcontains foo" to
+ // (mmutz 2001-11-05) hack to fix "<recipients> !contains foo" to
// meet user's expectations. See FAQ entry in KDE 2.2.2's KMail
// handbook
if ( function() == FuncEquals || function() == FuncNotEqual )
@@ -419,10 +419,10 @@ bool KMSearchRuleString::matchesInternal( const TQString & msgContents ) const
return ( TQString::compare( msgContents.lower(), contents().lower() ) != 0 );
case KMSearchRule::FuncContains:
- return ( msgContents.find( contents(), 0, false ) >= 0 );
+ return ( msgContents.tqfind( contents(), 0, false ) >= 0 );
case KMSearchRule::FuncContainsNot:
- return ( msgContents.find( contents(), 0, false ) < 0 );
+ return ( msgContents.tqfind( contents(), 0, false ) < 0 );
case KMSearchRule::FuncRegExp:
{
@@ -455,7 +455,7 @@ bool KMSearchRuleString::matchesInternal( const TQString & msgContents ) const
for( TQStringList::ConstIterator it = addressList.begin();
( it != addressList.end() );
++it ) {
- if ( !stdAb->tqfindByEmail( KPIM::getEmailAddress( *it ) ).isEmpty() )
+ if ( !stdAb->findByEmail( KPIM::getEmailAddress( *it ) ).isEmpty() )
return true;
}
return false;
@@ -468,7 +468,7 @@ bool KMSearchRuleString::matchesInternal( const TQString & msgContents ) const
for( TQStringList::ConstIterator it = addressList.begin();
( it != addressList.end() );
++it ) {
- if ( stdAb->tqfindByEmail( KPIM::getEmailAddress( *it ) ).isEmpty() )
+ if ( stdAb->findByEmail( KPIM::getEmailAddress( *it ) ).isEmpty() )
return true;
}
return false;
@@ -481,7 +481,7 @@ bool KMSearchRuleString::matchesInternal( const TQString & msgContents ) const
for( TQStringList::ConstIterator it = addressList.begin();
it != addressList.end(); ++it ) {
- KABC::Addressee::List addresses = stdAb->tqfindByEmail( KPIM::getEmailAddress( *it ) );
+ KABC::Addressee::List addresses = stdAb->findByEmail( KPIM::getEmailAddress( *it ) );
for ( KABC::Addressee::List::Iterator itAd = addresses.begin(); itAd != addresses.end(); ++itAd )
if ( (*itAd).hasCategory(category) )
@@ -498,7 +498,7 @@ bool KMSearchRuleString::matchesInternal( const TQString & msgContents ) const
for( TQStringList::ConstIterator it = addressList.begin();
it != addressList.end(); ++it ) {
- KABC::Addressee::List addresses = stdAb->tqfindByEmail( KPIM::getEmailAddress( *it ) );
+ KABC::Addressee::List addresses = stdAb->findByEmail( KPIM::getEmailAddress( *it ) );
for ( KABC::Addressee::List::Iterator itAd = addresses.begin(); itAd != addresses.end(); ++itAd )
if ( (*itAd).hasCategory(category) )
@@ -576,10 +576,10 @@ bool KMSearchRuleNumerical::matchesInternal( long numericalValue,
return ( numericalValue != numericalMsgContents );
case KMSearchRule::FuncContains:
- return ( msgContents.find( contents(), 0, false ) >= 0 );
+ return ( msgContents.tqfind( contents(), 0, false ) >= 0 );
case KMSearchRule::FuncContainsNot:
- return ( msgContents.find( contents(), 0, false ) < 0 );
+ return ( msgContents.tqfind( contents(), 0, false ) < 0 );
case KMSearchRule::FuncRegExp:
{
@@ -622,35 +622,35 @@ bool KMSearchRuleNumerical::matchesInternal( long numericalValue,
//==================================================
//
-// class KMSearchRuleStatus
+// class KMSearchRuletqStatus
//
//==================================================
-TQString englishNameForStatus( const KMMsgStatus& status )
+TQString englishNameFortqStatus( const KMMsgtqStatus& status )
{
for ( int i=0; i< numStatusNames; i++ ) {
if ( statusNames[i].status == status ) {
return statusNames[i].name;
}
}
- return TQString::null;
+ return TQString();
}
-KMSearchRuleStatus::KMSearchRuleStatus( const TQCString & field,
+KMSearchRuletqStatus::KMSearchRuletqStatus( 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
- mStatus = statusFromEnglishName( aContents );
+ mtqStatus = statusFromEnglishName( aContents );
}
-KMSearchRuleStatus::KMSearchRuleStatus( int status, Function func )
-: KMSearchRule( "<status>", func, englishNameForStatus( status ) )
+KMSearchRuletqStatus::KMSearchRuletqStatus( int status, Function func )
+: KMSearchRule( "<status>", func, englishNameFortqStatus( status ) )
{
- mStatus = status;
+ mtqStatus = status;
}
-KMMsgStatus KMSearchRuleStatus::statusFromEnglishName( const TQString & aStatusString )
+KMMsgtqStatus KMSearchRuletqStatus::statusFromEnglishName( const TQString & aStatusString )
{
for ( int i=0; i< numStatusNames; i++ ) {
if ( !aStatusString.compare( statusNames[i].name ) ) {
@@ -660,33 +660,33 @@ KMMsgStatus KMSearchRuleStatus::statusFromEnglishName( const TQString & aStatusS
return KMMsgStatusUnknown;
}
-bool KMSearchRuleStatus::isEmpty() const
+bool KMSearchRuletqStatus::isEmpty() const
{
return field().stripWhiteSpace().isEmpty() || contents().isEmpty();
}
-bool KMSearchRuleStatus::matches( const DwString &, KMMessage &,
+bool KMSearchRuletqStatus::matches( const DwString &, KMMessage &,
const DwBoyerMoore *, int ) const
{
assert( 0 );
return false; // don't warn
}
-bool KMSearchRuleStatus::matches( const KMMessage * msg ) const
+bool KMSearchRuletqStatus::matches( const KMMessage * msg ) const
{
- KMMsgStatus msgStatus = msg->status();
+ KMMsgtqStatus msgtqStatus = msg->status();
bool rc = false;
switch ( function() ) {
case FuncEquals: // fallthrough. So that "<status> 'is' 'read'" works
case FuncContains:
- if (msgStatus & mStatus)
+ if (msgtqStatus & mtqStatus)
rc = true;
break;
case FuncNotEqual: // fallthrough. So that "<status> 'is not' 'read'" works
case FuncContainsNot:
- if (! (msgStatus & mStatus) )
+ if (! (msgtqStatus & mtqStatus) )
rc = true;
break;
// FIXME what about the remaining funcs, how can they make sense for