diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /libkdepim/addresseelineedit.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/addresseelineedit.cpp')
-rw-r--r-- | libkdepim/addresseelineedit.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libkdepim/addresseelineedit.cpp b/libkdepim/addresseelineedit.cpp index 243b66086..0d86fad44 100644 --- a/libkdepim/addresseelineedit.cpp +++ b/libkdepim/addresseelineedit.cpp @@ -109,9 +109,9 @@ static bool itemIsHeader( const TQListBoxItem* item ) -AddresseeLineEdit::AddresseeLineEdit( TQWidget* parent, bool useCompletion, +AddresseeLineEdit::AddresseeLineEdit( TQWidget* tqparent, bool useCompletion, const char *name ) - : ClickLineEdit( parent, TQString::null, name ), DCOPObject( newLineEditDCOPObjectName() ), + : ClickLineEdit( tqparent, TQString(), name ), DCOPObject( newLineEditDCOPObjectName() ), m_useSemiColonAsSeparator( false ), m_allowDistLists( true ) { m_useCompletion = useCompletion; @@ -285,12 +285,12 @@ void AddresseeLineEdit::insert( const TQString &t ) KURL url( newText ); newText = url.path(); } - else if ( newText.find(" at ") != -1 ) { + else if ( newText.tqfind(" at ") != -1 ) { // Anti-spam stuff newText.tqreplace( " at ", "@" ); newText.tqreplace( " dot ", "." ); } - else if ( newText.find("(at)") != -1 ) { + else if ( newText.tqfind("(at)") != -1 ) { newText.tqreplace( TQRegExp("\\s*\\(at\\)\\s*"), "@" ); } @@ -310,7 +310,7 @@ void AddresseeLineEdit::insert( const TQString &t ) eot--; } if ( eot == 0 ) { - contents = TQString::null; + contents = TQString(); } else if ( pos >= eot ) { if ( contents[ eot - 1 ] == ',' ) { eot--; @@ -365,7 +365,7 @@ void AddresseeLineEdit::dropEvent( TQDropEvent *e ) while ( ( eot > 0 ) && contents[ eot - 1 ].isSpace() ) eot--; if ( eot == 0 ) - contents = TQString::null; + contents = TQString(); else if ( contents[ eot - 1 ] == ',' ) { eot--; contents.truncate( eot ); @@ -388,7 +388,7 @@ void AddresseeLineEdit::dropEvent( TQDropEvent *e ) return; } } else { - // Let's see if this drop tqcontains a comma separated list of emails + // Let's see if this drop contains a comma separated list of emails TQString dropData = TQString::fromUtf8( e->tqencodedData( "text/plain" ) ); TQStringList addrs = splitEmailAddrList( dropData ); if ( addrs.count() > 0 ) { @@ -482,7 +482,7 @@ void AddresseeLineEdit::doCompletion( bool ctrlT ) //if only our \" is left, remove it since user has not typed it either if ( m_searchExtended && m_searchString == "\"" ){ m_searchExtended = false; - m_searchString = TQString::null; + m_searchString = TQString(); setText( m_previousAddresses ); break; } @@ -567,7 +567,7 @@ void AddresseeLineEdit::loadContacts() KABC::Resource::Iterator it; for ( it = resource->begin(); it != resource->end(); ++it ) { TQString uid = (*it).uid(); - TQMap<TQString, TQString>::const_iterator wit = uidToResourceMap.find( uid ); + TQMap<TQString, TQString>::const_iterator wit = uidToResourceMap.tqfind( uid ); const TQString subresourceLabel = resabc->subresourceLabel( *wit ); const int weight = ( wit != uidToResourceMap.end() ) ? resabc->subresourceCompletionWeight( *wit ) : 80; const int idx = addCompletionSource( subresourceLabel, weight ); @@ -641,7 +641,7 @@ void AddresseeLineEdit::addContact( const KABC::Addressee& addr, int weight, int const TQString givenName = addr.givenName(); const TQString familyName= addr.familyName(); const TQString nickName = addr.nickName(); - const TQString domain = email.mid( email.find( '@' ) + 1 ); + const TQString domain = email.mid( email.tqfind( '@' ) + 1 ); TQString fullEmail = addr.fullEmail( email ); //TODO: let user decide what fields to use in lookup, e.g. company, city, ... @@ -757,10 +757,10 @@ void AddresseeLineEdit::addContact( const KABC::Addressee& addr, int weight, int void AddresseeLineEdit::addCompletionItem( const TQString& string, int weight, int completionItemSource, const TQStringList * keyWords ) { // Check if there is an exact match for item already, and use the max weight if so. - // Since there's no way to get the information from KCompletion, we have to keep our own QMap - CompletionItemsMap::iterator it = s_completionItemMap->find( string ); + // Since there's no way to get the information from KCompletion, we have to keep our own TQMap + CompletionItemsMap::iterator it = s_completionItemMap->tqfind( string ); if ( it != s_completionItemMap->end() ) { - weight = QMAX( ( *it ).first, weight ); + weight = TQMAX( ( *it ).first, weight ); ( *it ).first = weight; } else { s_completionItemMap->insert( string, qMakePair( weight, completionItemSource ) ); @@ -900,7 +900,7 @@ void AddresseeLineEdit::setCompletedItems( const TQStringList& items, bool autoS if ( autoSuggest ) { - int index = items.first().find( m_searchString ); + int index = items.first().tqfind( m_searchString ); TQString newText = items.first().mid( index ); setUserSelection(false); setCompletedText(newText,true); @@ -991,7 +991,7 @@ void AddresseeLineEdit::updateSearchString() m_previousAddresses = m_searchString.left( n ); m_searchString = m_searchString.mid( n ).stripWhiteSpace(); } else { - m_previousAddresses = TQString::null; + m_previousAddresses = TQString(); } } @@ -1020,7 +1020,7 @@ KCompletion::CompOrder KPIM::AddresseeLineEdit::completionOrder() int KPIM::AddresseeLineEdit::addCompletionSource( const TQString &source, int weight ) { - TQMap<TQString,int>::iterator it = s_completionSourceWeights->find( source ); + TQMap<TQString,int>::iterator it = s_completionSourceWeights->tqfind( source ); if ( it == s_completionSourceWeights->end() ) s_completionSourceWeights->insert( source, weight ); else @@ -1047,7 +1047,7 @@ bool KPIM::AddresseeLineEdit::eventFilter(TQObject *obj, TQEvent *e) TQListBoxItem *item = completionBox()->itemAt( me->pos() ); if ( !item ) { // In the case of a mouse move outside of the box we don't want - // the parent to fuzzy select a header by mistake. + // the tqparent to fuzzy select a header by mistake. bool eat = e->type() == TQEvent::MouseMove; return eat; } @@ -1061,7 +1061,7 @@ bool KPIM::AddresseeLineEdit::eventFilter(TQObject *obj, TQEvent *e) } else { // if we are not on one of the group heading, make sure the item // below or above is selected, not the heading, inadvertedly, due - // to fuzzy auto-selection from QListBox + // to fuzzy auto-selection from TQListBox completionBox()->setCurrentItem( item ); completionBox()->setSelected( completionBox()->index( item ), true ); if ( e->type() == TQEvent::MouseMove ) @@ -1145,7 +1145,7 @@ bool KPIM::AddresseeLineEdit::eventFilter(TQObject *obj, TQEvent *e) /// first, find the header of the current section TQListBoxItem *myHeader = 0; const int iterationstep = ke->key() == Key_Tab ? 1 : -1; - int i = QMIN( QMAX( currentIndex - iterationstep, 0 ), completionBox()->count() - 1 ); + int i = TQMIN( TQMAX( currentIndex - iterationstep, 0 ), completionBox()->count() - 1 ); while ( i>=0 ) { if ( itemIsHeader( completionBox()->item(i) ) ) { myHeader = completionBox()->item( i ); @@ -1228,7 +1228,7 @@ const TQStringList KPIM::AddresseeLineEdit::getAdjustedCompletionItems( bool ful TQMap<int, TQStringList> sections; TQStringList sortedItems; for ( TQStringList::Iterator it = items.begin(); it != items.end(); ++it, ++i ) { - CompletionItemsMap::const_iterator cit = s_completionItemMap->find(*it); + CompletionItemsMap::const_iterator cit = s_completionItemMap->tqfind(*it); if ( cit == s_completionItemMap->end() ) continue; int idx = (*cit).second; @@ -1236,7 +1236,7 @@ const TQStringList KPIM::AddresseeLineEdit::getAdjustedCompletionItems( bool ful if ( s_completion->order() == KCompletion::Weighted ) { if ( lastSourceIndex == -1 || lastSourceIndex != idx ) { const TQString sourceLabel( (*s_completionSources)[idx] ); - if ( sections.find(idx) == sections.end() ) { + if ( sections.tqfind(idx) == sections.end() ) { items.insert( it, sourceLabel ); } lastSourceIndex = idx; |