22 #include "kmailcompletion.h"
29 KMailCompletion::KMailCompletion()
31 setIgnoreCase( true );
42 TQString match = KCompletion::makeCompletion( string );
45 if ( !match.isEmpty() ){
46 const TQString firstMatch( match );
47 while ( match.find( TQRegExp( "(@)|(<.*>)" ) ) == -1 ) {
53 const TQStringList &mailAddr = m_keyMap[ match ];
55 for ( TQStringList::ConstIterator sit ( mailAddr.begin() ), sEnd( mailAddr.end() ); sit != sEnd; ++sit )
56 if ( (*sit).find( "<" + match + ">" ) != -1 || (*sit) == match ) {
64 if ( firstMatch == match ){
77 Q_ASSERT( keyWords != 0 );
78 for ( TQStringList::ConstIterator it( keyWords->begin() ); it != keyWords->end(); ++it ) {
79 TQStringList &emailList = m_keyMap[ (*it) ];
80 if ( emailList.find( email ) == emailList.end() )
81 emailList.append( email );
82 addItem( (*it),weight );
88 Q_ASSERT( pMatches != 0 );
89 if ( pMatches->isEmpty() )
93 TQMap< TQString, bool > mailAddrDistinct;
94 for ( TQStringList::ConstIterator sit ( pMatches->begin() ), sEnd( pMatches->end() ); sit != sEnd; ++sit ) {
95 const TQStringList &mailAddr = m_keyMap[ (*sit) ];
96 for ( TQStringList::ConstIterator sit ( mailAddr.begin() ), sEnd( mailAddr.end() ); sit != sEnd; ++sit ) {
97 mailAddrDistinct[ (*sit) ] = true;
101 (*pMatches) += mailAddrDistinct.keys();
103 #include "kmailcompletion.moc"
|