diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-08-09 22:25:47 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-08-09 22:25:47 -0500 |
commit | eaa7ee2e0bbca40ba3173c4304f81957e8964291 (patch) | |
tree | 4f793aa48a5080aedc94ce6e519c3b86708f2b88 /tqtinterface/qt4/tools/designer/plugins/cppeditor | |
parent | 79a9d7a46a20d4a0923bc06fc471fdc2176ef865 (diff) | |
download | experimental-eaa7ee2e0bbca40ba3173c4304f81957e8964291.tar.gz experimental-eaa7ee2e0bbca40ba3173c4304f81957e8964291.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
Diffstat (limited to 'tqtinterface/qt4/tools/designer/plugins/cppeditor')
9 files changed, 64 insertions, 64 deletions
diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp index 00dca68..82b1447 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppbrowser.cpp @@ -59,12 +59,12 @@ void CppEditorBrowser::showHelp( const TQString &w ) return; } - if ( word.tqfind( '(' ) != -1 ) { - TQString txt = "::" + word.left( word.tqfind( '(' ) ); + if ( word.find( '(' ) != -1 ) { + TQString txt = "::" + word.left( word.find( '(' ) ); TQTextDocument *doc = curEditor->document(); TQTextParagraph *p = doc->firstParagraph(); while ( p ) { - if ( p->string()->toString().tqfind( txt ) != -1 ) { + if ( p->string()->toString().find( txt ) != -1 ) { curEditor->setCursorPosition( p->paragId(), 0 ); return; } diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp index 46cd56e..f49e2d8 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/cppcompletion.cpp @@ -49,9 +49,9 @@ bool CppEditorCompletion::doObjectCompletion( const TQString &objName ) return FALSE; TQString object( objName ); int i = -1; - if ( ( i = object.tqfindRev( "->" ) ) != -1 ) + if ( ( i = object.findRev( "->" ) ) != -1 ) object = object.mid( i + 2 ); - if ( ( i = object.tqfindRev( "." ) ) != -1 ) + if ( ( i = object.findRev( "." ) ) != -1 ) object = object.mid( i + 1 ); object = object.simplifyWhiteSpace(); TQObject *obj = 0; @@ -69,7 +69,7 @@ bool CppEditorCompletion::doObjectCompletion( const TQString &objName ) if ( !obj->childrenListObject().isEmpty() ) { for ( TQObjectListIt cit( obj->childrenListObject() ); cit.current(); ++cit ) { TQString s( cit.current()->name() ); - if ( s.tqfind( " " ) == -1 && s.tqfind( "qt_" ) == -1 && s.tqfind( "unnamed" ) == -1 ) { + if ( s.find( " " ) == -1 && s.find( "qt_" ) == -1 && s.find( "unnamed" ) == -1 ) { CompletionEntry c; c.type = "variable"; c.text = s; @@ -92,19 +92,19 @@ bool CppEditorCompletion::doObjectCompletion( const TQString &objName ) ce.text = f; ce.postfix = "()"; - if ( lst.tqfind( ce ) == lst.end() ) + if ( lst.find( ce ) == lst.end() ) lst << ce; } TQStrList slts = obj->tqmetaObject()->slotNames( TRUE ); for ( TQPtrListIterator<char> sit( slts ); sit.current(); ++sit ) { TQString f( sit.current() ); - f = f.left( f.tqfind( "(" ) ); + f = f.left( f.find( "(" ) ); CompletionEntry c; c.type = "slot"; c.text = f; c.postfix = "()"; - if ( lst.tqfind( c ) == lst.end() ) + if ( lst.find( c ) == lst.end() ) lst << c; } @@ -127,16 +127,16 @@ TQValueList<TQStringList> CppEditorCompletion::functionParameters( const TQStrin TQString objName; int i = -1; - i = expr.tqfindRev( "->" ); + i = expr.findRev( "->" ); if ( i == -1 ) - i = expr.tqfindRev( "." ); + i = expr.findRev( "." ); else ++i; if ( i == -1 ) { - i = expr.tqfindRev( " " ); + i = expr.findRev( " " ); if ( i == -1 ) - i = expr.tqfindRev( "\t" ); + i = expr.findRev( "\t" ); else objName = ths->name(); @@ -155,16 +155,16 @@ TQValueList<TQStringList> CppEditorCompletion::functionParameters( const TQStrin if ( ex[ (int)ex.length() - 1 ] == '-' ) ex.remove( ex.length() - 1, 1 ); int j = -1; - j = ex.tqfindRev( "->" ); + j = ex.findRev( "->" ); if ( j == -1 ) - j = ex.tqfindRev( "." ); + j = ex.findRev( "." ); else ++j; if ( j == -1 ) { - j = ex.tqfindRev( " " ); + j = ex.findRev( " " ); if ( j == -1 ) - j = ex.tqfindRev( "\t" ); + j = ex.findRev( "\t" ); else objName = ths->name(); @@ -188,11 +188,11 @@ TQValueList<TQStringList> CppEditorCompletion::functionParameters( const TQStrin TQStrList slts = obj->tqmetaObject()->slotNames( TRUE ); for ( TQPtrListIterator<char> sit( slts ); sit.current(); ++sit ) { TQString f( sit.current() ); - f = f.left( f.tqfind( "(" ) ); + f = f.left( f.find( "(" ) ); if ( f == func ) { f = TQString( sit.current() ); - f.remove( (uint)0, f.tqfind( "(" ) + 1 ); - f = f.left( f.tqfind( ")" ) ); + f.remove( (uint)0, f.find( "(" ) + 1 ); + f = f.left( f.find( ")" ) ); TQStringList lst = TQStringList::split( ',', f ); if ( !lst.isEmpty() ) { TQValueList<TQStringList> l; @@ -204,7 +204,7 @@ TQValueList<TQStringList> CppEditorCompletion::functionParameters( const TQStrin const TQMetaProperty *prop = obj->tqmetaObject()-> - property( obj->tqmetaObject()->tqfindProperty( func[ 3 ].lower() + func.mid( 4 ), TRUE ), TRUE ); + property( obj->tqmetaObject()->findProperty( func[ 3 ].lower() + func.mid( 4 ), TRUE ), TRUE ); if ( prop ) { TQValueList<TQStringList> l; l << TQStringList( prop->type() ); diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp index 736b082..9d34421 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.cpp @@ -165,40 +165,40 @@ void EditorInterfaceImpl::selectAll() ( (CppEditor*)viewManager->currentView() )->selectAll(); } -bool EditorInterfaceImpl::tqfind( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor ) +bool EditorInterfaceImpl::find( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor ) { if ( !viewManager || !viewManager->currentView() ) return FALSE; CppEditor *e = (CppEditor*)viewManager->currentView(); if ( startAtCursor ) - return e->tqfind( expr, cs, wo, forward ); + return e->find( expr, cs, wo, forward ); int dummy = 0; - return e->tqfind( expr, cs, wo, forward, &dummy, &dummy ); + return e->find( expr, cs, wo, forward, &dummy, &dummy ); } -bool EditorInterfaceImpl::tqreplace( const TQString &tqfind, const TQString &tqreplace, bool cs, bool wo, - bool forward, bool startAtCursor, bool tqreplaceAll ) +bool EditorInterfaceImpl::replace( const TQString &find, const TQString &replace, bool cs, bool wo, + bool forward, bool startAtCursor, bool replaceAll ) { if ( !viewManager || !viewManager->currentView() ) return FALSE; CppEditor *e = (CppEditor*)viewManager->currentView(); bool ok = FALSE; if ( startAtCursor ) { - ok = e->tqfind( tqfind, cs, wo, forward ); + ok = e->find( find, cs, wo, forward ); } else { int dummy = 0; - ok = e->tqfind( tqfind, cs, wo, forward, &dummy, &dummy ); + ok = e->find( find, cs, wo, forward, &dummy, &dummy ); } if ( ok ) { e->removeSelectedText(); - e->insert( tqreplace, FALSE, FALSE ); + e->insert( replace, FALSE, FALSE ); } - if ( !tqreplaceAll || !ok ) { + if ( !replaceAll || !ok ) { if ( ok ) e->setSelection( e->textCursor()->paragraph()->paragId(), - e->textCursor()->index() - tqreplace.length(), + e->textCursor()->index() - replace.length(), e->textCursor()->paragraph()->paragId(), e->textCursor()->index() ); return ok; @@ -206,10 +206,10 @@ bool EditorInterfaceImpl::tqreplace( const TQString &tqfind, const TQString &tqr bool ok2 = TRUE; while ( ok2 ) { - ok2 = e->tqfind( tqfind, cs, wo, forward ); + ok2 = e->find( find, cs, wo, forward ); if ( ok2 ) { e->removeSelectedText(); - e->insert( tqreplace, FALSE, FALSE ); + e->insert( replace, FALSE, FALSE ); } } @@ -249,7 +249,7 @@ void EditorInterfaceImpl::scrollTo( const TQString &txt, const TQString & ) TQTextDocument *doc = ( (CppEditor*)viewManager->currentView() )->document(); TQTextParagraph *p = doc->firstParagraph(); while ( p ) { - if ( p->string()->toString().tqfind( txt ) != -1 ) { + if ( p->string()->toString().find( txt ) != -1 ) { ( (CppEditor*)viewManager->currentView() )->setCursorPosition( p->paragId() + 2, 0 ); break; } diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h index 997a99b..5bae764 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/editorinterfaceimpl.h @@ -66,8 +66,8 @@ public: void copy(); void paste(); void selectAll(); - bool tqfind( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor ); - bool tqreplace( const TQString &tqfind, const TQString &tqreplace, bool cs, bool wo, bool forward, bool startAtCursor, bool tqreplaceAll ); + bool find( const TQString &expr, bool cs, bool wo, bool forward, bool startAtCursor ); + bool replace( const TQString &find, const TQString &replace, bool cs, bool wo, bool forward, bool startAtCursor, bool replaceAll ); void gotoLine( int line ); void indent(); void scrollTo( const TQString &txt, const TQString &first ); diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp index 14489c5..da857b5 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/languageinterfaceimpl.cpp @@ -93,9 +93,9 @@ void LanguageInterfaceImpl::functions( const TQString &code, TQValueList<Functio Function func; func.name = (*it).prototype(); func.name.remove( 0, (*it).returnType().length() ); - if ( func.name.tqfind( "::" ) == -1 ) + if ( func.name.find( "::" ) == -1 ) continue; - func.name.remove( (uint)0, func.name.tqfind( "::" ) + 2 ); + func.name.remove( (uint)0, func.name.find( "::" ) + 2 ); func.body = (*it).body(); func.returnType = (*it).returnType(); func.start = (*it).functionStartLineNum(); @@ -194,7 +194,7 @@ TQString LanguageInterfaceImpl::projectKeyForExtension( const TQString &extensio { // also handle something like foo.ut.cpp TQString ext = extension; - int i = ext.tqfindRev('.'); + int i = ext.findRev('.'); if ( i > -1 && i < (int)(ext.length()-1) ) ext = ext.mid( i + 1 ); if ( ext[ 0 ] == 'c' || ext[ 0 ] == 'C' ) diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h index 72aea91..9902c17 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/projectsettings.ui.h @@ -36,10 +36,10 @@ void CppProjectSettings::reInit( TQUnknownInterface *iface ) const TQString platforms[] = { "(all)", "win32", "unix", "mac", TQString() }; for ( int i = 0; platforms[ i ] != TQString(); ++i ) { - config.tqreplace( platforms[ i ], project->config( platforms[ i ] ) ); - libs.tqreplace( platforms[ i ], project->libs( platforms[ i ] ) ); - defines.tqreplace( platforms[ i ], project->defines( platforms[ i ] ) ); - includes.tqreplace( platforms[ i ], project->includePath( platforms[ i ] ) ); + config.replace( platforms[ i ], project->config( platforms[ i ] ) ); + libs.replace( platforms[ i ], project->libs( platforms[ i ] ) ); + defines.replace( platforms[ i ], project->defines( platforms[ i ] ) ); + includes.replace( platforms[ i ], project->includePath( platforms[ i ] ) ); } editConfig->setText( config[ "(all)" ] ); editLibs->setText( libs[ "(all)" ] ); @@ -67,22 +67,22 @@ void CppProjectSettings::save( TQUnknownInterface *iface ) void CppProjectSettings::configChanged( const TQString &str ) { - config.tqreplace( comboConfig->currentText(), str ); + config.replace( comboConfig->currentText(), str ); } void CppProjectSettings::libsChanged( const TQString &str ) { - libs.tqreplace( comboLibs->currentText(), str ); + libs.replace( comboLibs->currentText(), str ); } void CppProjectSettings::definesChanged( const TQString &str ) { - defines.tqreplace( comboDefines->currentText(), str ); + defines.replace( comboDefines->currentText(), str ); } void CppProjectSettings::includesChanged( const TQString &str ) { - includes.tqreplace( comboInclude->currentText(), str ); + includes.replace( comboInclude->currentText(), str ); } void CppProjectSettings::configPlatformChanged( const TQString &plat ) diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp index fe84703..5d3c96f 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/sourcetemplateinterfaceimpl.cpp @@ -100,7 +100,7 @@ SourceTemplateInterface::Source SourceTemplateInterfaceImpl::create( const TQStr formFileName( dia.listForms->text( dia.listForms->currentItem() ) ); include.remove( include.length() - 2, 2 ); include += "h"; - int slashFind = include.tqfindRev('/'); + int slashFind = include.findRev('/'); if (slashFind != -1) include = include.mid(slashFind+1); src.code = generateMainCppCode( dia.listForms->text( dia.listForms->currentItem() ), diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp index 251e2b5..0217682 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/syntaxhighliter_cpp.cpp @@ -153,7 +153,7 @@ SyntaxHighlighter_CPP::SyntaxHighlighter_CPP() int len; for ( int i = 0; keywords[ i ]; ++i ) { len = (int)strlen( keywords[ i ] ); - if ( !wordMap->tqcontains( len ) ) + if ( !wordMap->contains( len ) ) wordMap->insert( len, TQMap<TQString, int >() ); TQMap<TQString, int> &map = wordMap->operator[]( len ); map[ keywords[ i ] ] = Keyword; @@ -330,11 +330,11 @@ void SyntaxHighlighter_CPP::process( TQTextDocument *doc, TQTextParagraph *strin break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': - if ( alphabeth.tqfind( lastChar ) != -1 && - ( mathChars.tqfind( lastChar ) == -1 || numbers.tqfind( string->at( i - 1 )->c ) == -1 ) ) { + if ( alphabeth.find( lastChar ) != -1 && + ( mathChars.find( lastChar ) == -1 || numbers.find( string->at( i - 1 )->c ) == -1 ) ) { input = InputAlpha; } else { - if ( input == InputAlpha && numbers.tqfind( lastChar ) != -1 ) + if ( input == InputAlpha && numbers.find( lastChar ) != -1 ) input = InputAlpha; else input = InputNumber; @@ -381,9 +381,9 @@ void SyntaxHighlighter_CPP::process( TQTextDocument *doc, TQTextParagraph *strin if ( buffer[ 0 ] == 'Q' ) { string->setFormat( i - buffer.length(), buffer.length(), formatType, FALSE ); } else { - TQMap<int, TQMap<TQString, int > >::Iterator it = wordMap->tqfind( len ); + TQMap<int, TQMap<TQString, int > >::Iterator it = wordMap->find( len ); if ( it != wordMap->end() ) { - TQMap<TQString, int >::Iterator it2 = ( *it ).tqfind( buffer ); + TQMap<TQString, int >::Iterator it2 = ( *it ).find( buffer ); if ( it2 != ( *it ).end() ) string->setFormat( i - buffer.length(), buffer.length(), format( ( *it2 ) ), FALSE ); } diff --git a/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp b/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp index ab69cce..e1b41b5 100644 --- a/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp +++ b/tqtinterface/qt4/tools/designer/plugins/cppeditor/yyreg.cpp @@ -180,10 +180,10 @@ static int getToken() qDebug()'s here and there. */ if ( yyCurPos >= 0 ) { - int lineStart = yyIn->tqfindRev( TQChar('\n'), yyCurPos ) + 1; + int lineStart = yyIn->findRev( TQChar('\n'), yyCurPos ) + 1; TQString line = yyIn->mid( lineStart, yyCurPos - lineStart + 2 ); - int commentStart = line.tqfind( TQString("//") ); + int commentStart = line.find( TQString("//") ); if ( commentStart != -1 ) { yyCurPos = lineStart + commentStart - 1; yyPos = yyCurPos + 2; @@ -392,7 +392,7 @@ TQString CppFunction::prototype() const /* The parser follows. We are not really parsing C++, just trying to - tqfind the start and end of function definitions. + find the start and end of function definitions. One important pitfall is that the parsed code needs not be valid. Parsing from right to left helps cope with that, as explained in @@ -654,7 +654,7 @@ static CppFunction matchFunctionPrototype( bool stripParamNames ) functions and one that relates to the following function. One good heuristic is to assume that a comment immediately followed by a function with no blank line in between relates to the - function, but there's no easy way to tqfind that out with a + function, but there's no easy way to find that out with a tokenizer. */ #if 0 @@ -689,7 +689,7 @@ static CppFunction matchFunctionPrototype( bool stripParamNames ) printf( " world!\n" ); } - The parser first tqfinds bar(). Then it tqfinds "void foo() {" and + The parser first finds bar(). Then it finds "void foo() {" and naively expects the body to extend up to "void bar()". This function's job is to count braces and make sure "int n;" is not counted as part of the body. @@ -733,8 +733,8 @@ static void setBody( CppFunction *func, const TQString& somewhatBody ) } The parser looks for left braces and tries to parse a function - prototype backwards. First it tqfinds "void bar() {". Then it works - up and tqfinds "void foo() {". + prototype backwards. First it finds "void bar() {". Then it works + up and finds "void foo() {". */ static void matchTranslationUnit( TQValueList<CppFunction> *flist ) { @@ -763,11 +763,11 @@ static void matchTranslationUnit( TQValueList<CppFunction> *flist ) Compute important line numbers. */ int functionStartLineNo = 1 + TQConstString( yyIn->tqunicode(), yyPos ) - .string().tqcontains( TQChar('\n') ); + .string().contains( TQChar('\n') ); int startLineNo = functionStartLineNo + TQConstString( yyIn->tqunicode() + yyPos, startBody - yyPos ) - .string().tqcontains( TQChar('\n') ); - int endLineNo = startLineNo + body.tqcontains( TQChar('\n') ); + .string().contains( TQChar('\n') ); + int endLineNo = startLineNo + body.contains( TQChar('\n') ); func.setLineNums( functionStartLineNo, startLineNo, endLineNo ); flist->prepend( func ); |