diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-02-16 20:17:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-02-16 20:17:18 +0000 |
commit | f4fae92b6768541e2952173c3d4b09040f95bf7e (patch) | |
tree | d8c5d93232235cd635f3310b4d95490df181ba2d /libkdepim/kregexp3.cpp | |
parent | 125c0a08265b75a133644d3b55f47e37c919f45d (diff) | |
download | tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip |
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/kregexp3.cpp')
-rw-r--r-- | libkdepim/kregexp3.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libkdepim/kregexp3.cpp b/libkdepim/kregexp3.cpp index 6bb519e56..f34dad339 100644 --- a/libkdepim/kregexp3.cpp +++ b/libkdepim/kregexp3.cpp @@ -37,13 +37,13 @@ #include <kdebug.h> #endif -TQString KRegExp3::replace( const TQString & str, - const TQString & replacementStr, +TQString KRegExp3::tqreplace( const TQString & str, + const TQString & tqreplacementStr, int start, bool global ) { int oldpos, pos; - //-------- parsing the replacementStr into + //-------- parsing the tqreplacementStr into //-------- literal parts and backreferences: TQStringList literalStrs; TQValueList<int> backRefs; @@ -55,30 +55,30 @@ TQString KRegExp3::replace( const TQString & str, TQRegExp brx("\\"); #ifdef DEBUG_KREGEXP3 - kdDebug() << "Analyzing replacementStr: \"" + replacementStr + "\"" << endl; + kdDebug() << "Analyzing tqreplacementStr: \"" + tqreplacementStr + "\"" << endl; #endif oldpos = 0; pos = 0; while ( true ) { - pos = rx.search( replacementStr, pos ); + pos = rx.search( tqreplacementStr, pos ); #ifdef DEBUG_KREGEXP3 kdDebug() << TQString(" Found match at pos %1").arg(pos) << endl; #endif if ( pos < 0 ) { - literalStrs << replacementStr.mid( oldpos ) - .replace( bbrx, "\\" ) - .replace( brx, "" ); + literalStrs << tqreplacementStr.mid( oldpos ) + .tqreplace( bbrx, "\\" ) + .tqreplace( brx, "" ); #ifdef DEBUG_KREGEXP3 kdDebug() << " No more matches. Last literal is \"" + literalStrs.last() + "\"" << endl; #endif break; } else { - literalStrs << replacementStr.mid( oldpos, pos-oldpos ) - .replace( bbrx, "\\" ) - .replace( brx, "" ); + literalStrs << tqreplacementStr.mid( oldpos, pos-oldpos ) + .tqreplace( bbrx, "\\" ) + .tqreplace( brx, "" ); #ifdef DEBUG_KREGEXP3 kdDebug() << TQString(" Inserting \"") + literalStrs.last() + "\" as literal." << endl; kdDebug() << " Searching for corresponding digit(s):" << endl; @@ -101,7 +101,7 @@ TQString KRegExp3::replace( const TQString & str, } #ifdef DEBUG_KREGEXP3 - kdDebug() << "Finished the analysis of replacementStr!" << endl; + kdDebug() << "Finished the analysis of tqreplacementStr!" << endl; #endif Q_ASSERT( literalStrs.count() == backRefs.count() + 1 ); @@ -145,7 +145,7 @@ TQString KRegExp3::replace( const TQString & str, iIt != backRefs.end() ; ++sIt, ++iIt ) { result += (*sIt); #ifdef DEBUG_KREGEXP3 - kdDebug() << " Adding literal replacement part:" << endl; + kdDebug() << " Adding literal tqreplacement part:" << endl; kdDebug() << " result == \"" + result + "\"" << endl; #endif result += cap( (*iIt) ); @@ -156,7 +156,7 @@ TQString KRegExp3::replace( const TQString & str, } result += (*sIt); #ifdef DEBUG_KREGEXP3 - kdDebug() << " Adding literal replacement part:" << endl; + kdDebug() << " Adding literal tqreplacement part:" << endl; kdDebug() << " result == \"" + result + "\"" << endl; #endif } @@ -173,7 +173,7 @@ TQString KRegExp3::replace( const TQString & str, oldpos = pos; if ( !global ) { - // only replace the first occurrence, so stop here: + // only tqreplace the first occurrence, so stop here: result += str.mid( oldpos ); break; } |