diff options
Diffstat (limited to 'experimental/tqtinterface/qt4/tools/linguist/shared/proparser.cpp')
-rw-r--r-- | experimental/tqtinterface/qt4/tools/linguist/shared/proparser.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/experimental/tqtinterface/qt4/tools/linguist/shared/proparser.cpp b/experimental/tqtinterface/qt4/tools/linguist/shared/proparser.cpp index 12af0ecf0..ab32500c4 100644 --- a/experimental/tqtinterface/qt4/tools/linguist/shared/proparser.cpp +++ b/experimental/tqtinterface/qt4/tools/linguist/shared/proparser.cpp @@ -77,7 +77,7 @@ TQMap<TQString, TQString> proFileTagMap( const TQString& text ) still need to do it after we include to make sure the included file does not have comments */ - t.tqreplace( TQRegExp(TQString("#[^\n]*\n")), TQString(" ") ); + t.replace( TQRegExp(TQString("#[^\n]*\n")), TQString(" ") ); /* Process include() commands. @@ -89,39 +89,39 @@ TQMap<TQString, TQString> proFileTagMap( const TQString& text ) while ( (i = callToInclude.search(t, i)) != -1 ) { bool doneWithVar = false; TQString fileName = callToInclude.cap(1); - TQString after = fileName.tqreplace("$$PWD", TQDir::currentDirPath()); - if (!tagMap.isEmpty() && after.tqcontains("$$")) { + TQString after = fileName.replace("$$PWD", TQDir::currentDirPath()); + if (!tagMap.isEmpty() && after.contains("$$")) { TQRegExp var( "\\$\\$[({]?([a-zA-Z0-9_]+)[)}]?" ); int ii = 0; - while ((ii = after.tqfind(var, ii)) != -1) { - if (tagMap.tqcontains(var.cap(1))) { - after.tqreplace(ii, var.cap(0).length(), tagMap[var.cap(1)]); - } else { // Couldn't tqfind it + while ((ii = after.find(var, ii)) != -1) { + if (tagMap.contains(var.cap(1))) { + after.replace(ii, var.cap(0).length(), tagMap[var.cap(1)]); + } else { // Couldn't find it doneWithVar = true; break; } } } - if (doneWithVar || !after.tqcontains("$$")) { + if (doneWithVar || !after.contains("$$")) { after = loadFile(after); TQFileInfo fi(callToInclude.cap(1)); - after.tqreplace("$$PWD", fi.dirPath()); - t.tqreplace( i, callToInclude.matchedLength(), after ); + after.replace("$$PWD", fi.dirPath()); + t.replace( i, callToInclude.matchedLength(), after ); } i += after.length(); } /* Strip comments, merge lines ending with backslash, add - spaces around '=' and '+=', tqreplace '\n' with ';', and + spaces around '=' and '+=', replace '\n' with ';', and simplify white spaces. */ - t.tqreplace( TQRegExp(TQString("#[^\n]*\n")), TQString(" ") ); - t.tqreplace( TQRegExp(TQString("\\\\[^\n\\S]*\n")), TQString(" ") ); - t.tqreplace( "=", TQString(" = ") ); - t.tqreplace( "+ =", TQString(" += ") ); - t.tqreplace( "\n", TQString(";") ); + t.replace( TQRegExp(TQString("#[^\n]*\n")), TQString(" ") ); + t.replace( TQRegExp(TQString("\\\\[^\n\\S]*\n")), TQString(" ") ); + t.replace( "=", TQString(" = ") ); + t.replace( "+ =", TQString(" += ") ); + t.replace( "\n", TQString(";") ); t = t.simplifyWhiteSpace(); /* @@ -135,7 +135,7 @@ TQMap<TQString, TQString> proFileTagMap( const TQString& text ) if ( toks.count() >= 3 && (toks[1] == TQString("=") || toks[1] == TQString("+=")) ) { TQString tag = toks.first(); - int k = tag.tqfindRev( TQChar(':') ); // as in 'unix:' + int k = tag.findRev( TQChar(':') ); // as in 'unix:' if ( k != -1 ) tag = tag.mid( k + 1 ); toks.remove( toks.begin() ); @@ -143,9 +143,9 @@ TQMap<TQString, TQString> proFileTagMap( const TQString& text ) TQString action = toks.first(); toks.remove( toks.begin() ); - if ( tagMap.tqcontains(tag) ) { + if ( tagMap.contains(tag) ) { if ( action == TQString("=") ) - tagMap.tqreplace( tag, toks.join(TQChar(' ')) ); + tagMap.replace( tag, toks.join(TQChar(' ')) ); else tagMap[tag] += TQChar( ' ' ) + toks.join( TQChar(' ') ); } else { @@ -171,11 +171,11 @@ TQMap<TQString, TQString> proFileTagMap( const TQString& text ) // skip system(); it will be handled in the next pass ++i; } else { - if ( tagMap.tqcontains(invocation) ) + if ( tagMap.contains(invocation) ) after = tagMap[invocation]; else if (invocation.lower() == "pwd") after = TQDir::currentDirPath(); - (*it).tqreplace( i, len, after ); + (*it).replace( i, len, after ); i += after.length(); } } @@ -207,7 +207,7 @@ TQMap<TQString, TQString> proFileTagMap( const TQString& text ) buff[read_in] = '\0'; after += buff; } - (*it).tqreplace( i, callToSystem.matchedLength(), after ); + (*it).replace( i, callToSystem.matchedLength(), after ); i += after.length(); } } |