diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkdepim/kmailcompletion.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/kmailcompletion.cpp')
-rw-r--r-- | libkdepim/kmailcompletion.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libkdepim/kmailcompletion.cpp b/libkdepim/kmailcompletion.cpp index 41d2f2ce8..b7c37852c 100644 --- a/libkdepim/kmailcompletion.cpp +++ b/libkdepim/kmailcompletion.cpp @@ -22,7 +22,7 @@ #include "kmailcompletion.h" #include <kdebug.h> -#include <qregexp.h> +#include <tqregexp.h> using namespace KPIM; @@ -37,22 +37,22 @@ void KMailCompletion::clear() KCompletion::clear(); } -QString KMailCompletion::makeCompletion( const QString &string ) +TQString KMailCompletion::makeCompletion( const TQString &string ) { - QString match = KCompletion::makeCompletion( string ); + TQString match = KCompletion::makeCompletion( string ); // this should be in postProcessMatch, but postProcessMatch is const and will not allow nextMatch if ( !match.isEmpty() ){ - const QString firstMatch( match ); - while ( match.find( QRegExp( "(@)|(<.*>)" ) ) == -1 ) { + const TQString firstMatch( match ); + while ( match.find( TQRegExp( "(@)|(<.*>)" ) ) == -1 ) { /* local email do not require @domain part, if match is an address we'll find * last+first <match> in m_keyMap and we'll know that match is already a valid email. * * Distribution list do not have last+first <match> entry, they will be in mailAddr */ - const QStringList &mailAddr = m_keyMap[ match ]; //get all mailAddr for this keyword + const TQStringList &mailAddr = m_keyMap[ match ]; //get all mailAddr for this keyword bool isEmail = false; - for ( QStringList::ConstIterator sit ( mailAddr.begin() ), sEnd( mailAddr.end() ); sit != sEnd; ++sit ) + for ( TQStringList::ConstIterator sit ( mailAddr.begin() ), sEnd( mailAddr.end() ); sit != sEnd; ++sit ) if ( (*sit).find( "<" + match + ">" ) != -1 || (*sit) == match ) { isEmail = true; break; @@ -62,7 +62,7 @@ QString KMailCompletion::makeCompletion( const QString &string ) // match is a keyword, skip it and try to find match <email@domain> match = nextMatch(); if ( firstMatch == match ){ - match = QString::null; + match = TQString::null; break; } } else @@ -72,29 +72,29 @@ QString KMailCompletion::makeCompletion( const QString &string ) return match; } -void KMailCompletion::addItemWithKeys( const QString& email, int weight, const QStringList* keyWords) +void KMailCompletion::addItemWithKeys( const TQString& email, int weight, const TQStringList* keyWords) { Q_ASSERT( keyWords != 0 ); - for ( QStringList::ConstIterator it( keyWords->begin() ); it != keyWords->end(); ++it ) { - QStringList &emailList = m_keyMap[ (*it) ]; //lookup email-list for given keyword + for ( TQStringList::ConstIterator it( keyWords->begin() ); it != keyWords->end(); ++it ) { + TQStringList &emailList = m_keyMap[ (*it) ]; //lookup email-list for given keyword if ( emailList.find( email ) == emailList.end() ) //add email if not there emailList.append( email ); addItem( (*it),weight ); //inform KCompletion about keyword } } -void KMailCompletion::postProcessMatches( QStringList * pMatches )const +void KMailCompletion::postProcessMatches( TQStringList * pMatches )const { Q_ASSERT( pMatches != 0 ); if ( pMatches->isEmpty() ) return; //KCompletion has found the keywords for us, we can now map them to mail-addr - QMap< QString, bool > mailAddrDistinct; //TODO replace with QSet in KDE4 - for ( QStringList::ConstIterator sit ( pMatches->begin() ), sEnd( pMatches->end() ); sit != sEnd; ++sit ) { - const QStringList &mailAddr = m_keyMap[ (*sit) ]; //get all mailAddr for this keyword - for ( QStringList::ConstIterator sit ( mailAddr.begin() ), sEnd( mailAddr.end() ); sit != sEnd; ++sit ) { - mailAddrDistinct[ (*sit) ] = true; //store mailAddr, QMap will make them unique + TQMap< TQString, bool > mailAddrDistinct; //TODO replace with QSet in KDE4 + for ( TQStringList::ConstIterator sit ( pMatches->begin() ), sEnd( pMatches->end() ); sit != sEnd; ++sit ) { + const TQStringList &mailAddr = m_keyMap[ (*sit) ]; //get all mailAddr for this keyword + for ( TQStringList::ConstIterator sit ( mailAddr.begin() ), sEnd( mailAddr.end() ); sit != sEnd; ++sit ) { + mailAddrDistinct[ (*sit) ] = true; //store mailAddr, TQMap will make them unique } } pMatches->clear(); //delete keywords |