summaryrefslogtreecommitdiffstats
path: root/kdecore/kmacroexpander.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
commit560378aaca1784ba19806a0414a32b20c744de39 (patch)
treece0dfd7c3febf2a1adc7603d1019a8be2083c415 /kdecore/kmacroexpander.cpp
parentd4d5af1cdbd3cc65d095e0afc5b1f4260091cf5d (diff)
downloadtdelibs-560378aaca1784ba19806a0414a32b20c744de39.tar.gz
tdelibs-560378aaca1784ba19806a0414a32b20c744de39.zip
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/kmacroexpander.cpp')
-rw-r--r--kdecore/kmacroexpander.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/kdecore/kmacroexpander.cpp b/kdecore/kmacroexpander.cpp
index 5516c1b61..9c7e5da24 100644
--- a/kdecore/kmacroexpander.cpp
+++ b/kdecore/kmacroexpander.cpp
@@ -56,7 +56,7 @@ void KMacroExpanderBase::expandMacros( TQString &str )
for (pos = 0; pos < str.length(); ) {
if (ec != (QChar)0) {
- if (str.unicode()[pos] != ec)
+ if (str.tqunicode()[pos] != ec)
goto nohit;
if (!(len = expandEscapedMacro( str, pos, rst )))
goto nohit;
@@ -70,7 +70,7 @@ void KMacroExpanderBase::expandMacros( TQString &str )
}
rsts = rst.join( " " );
rst.clear();
- str.replace( pos, len, rsts );
+ str.tqreplace( pos, len, rsts );
pos += rsts.length();
continue;
nohit:
@@ -109,7 +109,7 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
TQString rsts;
while (pos < str.length()) {
- TQChar cc( str.unicode()[pos] );
+ TQChar cc( str.tqunicode()[pos] );
if (ec != (QChar)0) {
if (cc != ec)
goto nohit;
@@ -125,13 +125,13 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
}
if (state.dquote) {
rsts = rst.join( " " );
- rsts.replace( TQRegExp("([$`\"\\\\])"), "\\\\1" );
+ rsts.tqreplace( TQRegExp("([$`\"\\\\])"), "\\\\1" );
} else if (state.current == dollarquote) {
rsts = rst.join( " " );
- rsts.replace( TQRegExp("(['\\\\])"), "\\\\1" );
+ rsts.tqreplace( TQRegExp("(['\\\\])"), "\\\\1" );
} else if (state.current == singlequote) {
rsts = rst.join( " " );
- rsts.replace( '\'', "'\\''");
+ rsts.tqreplace( '\'', "'\\''");
} else {
if (rst.isEmpty()) {
str.remove( pos, len );
@@ -140,14 +140,14 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
rsts = "'";
#if 0 // this could pay off if join() would be cleverer and the strings were long
for (TQStringList::Iterator it = rst.begin(); it != rst.end(); ++it)
- (*it).replace( '\'', "'\\''" );
+ (*it).tqreplace( '\'', "'\\''" );
rsts += rst.join( "' '" );
#else
for (TQStringList::ConstIterator it = rst.begin(); it != rst.end(); ++it) {
if (it != rst.begin())
rsts += "' '";
TQString trsts( *it );
- trsts.replace( '\'', "'\\''" );
+ trsts.tqreplace( '\'', "'\\''" );
rsts += trsts;
}
#endif
@@ -155,7 +155,7 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
}
}
rst.clear();
- str.replace( pos, len, rsts );
+ str.tqreplace( pos, len, rsts );
pos += rsts.length();
continue;
nohit:
@@ -198,14 +198,14 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
}
// always swallow the char -> prevent anomalies due to expansion
} else if (cc == (QChar)'`') {
- str.replace( pos, 1, "$( " ); // add space -> avoid creating $((
+ str.tqreplace( pos, 1, "$( " ); // add space -> avoid creating $((
pos2 = pos += 3;
for (;;) {
if (pos2 >= str.length()) {
pos = pos2;
return false;
}
- cc = str.unicode()[pos2];
+ cc = str.tqunicode()[pos2];
if (cc == (QChar)'`')
break;
if (cc == (QChar)'\\') {
@@ -339,7 +339,7 @@ template<class VT>
int
KMacroMapExpander<TQChar,VT>::expandPlainMacro( const TQString &str, uint pos, TQStringList &ret )
{
- TQMapConstIterator<TQChar,VT> it = macromap.find(str[pos]);
+ TQMapConstIterator<TQChar,VT> it = macromap.tqfind(str[pos]);
if (it != macromap.end()) {
ret += it.data();
return 1;
@@ -355,7 +355,7 @@ KMacroMapExpander<TQChar,VT>::expandEscapedMacro( const TQString &str, uint pos,
ret += TQString( escapeChar() );
return 2;
}
- TQMapConstIterator<TQChar,VT> it = macromap.find(str[pos+1]);
+ TQMapConstIterator<TQChar,VT> it = macromap.tqfind(str[pos+1]);
if (it != macromap.end()) {
ret += it.data();
return 2;
@@ -383,14 +383,14 @@ template<class VT>
int
KMacroMapExpander<TQString,VT>::expandPlainMacro( const TQString &str, uint pos, TQStringList &ret )
{
- if (isIdentifier( str[pos - 1].unicode() ))
+ if (isIdentifier( str[pos - 1].tqunicode() ))
return 0;
uint sl;
- for (sl = 0; isIdentifier( str[pos + sl].unicode() ); sl++);
+ for (sl = 0; isIdentifier( str[pos + sl].tqunicode() ); sl++);
if (!sl)
return 0;
TQMapConstIterator<TQString,VT> it =
- macromap.find( TQConstString( str.unicode() + pos, sl ).string() );
+ macromap.tqfind( TQConstString( str.tqunicode() + pos, sl ).string() );
if (it != macromap.end()) {
ret += it.data();
return sl;
@@ -415,13 +415,13 @@ KMacroMapExpander<TQString,VT>::expandEscapedMacro( const TQString &str, uint po
rsl = sl + 3;
} else {
rpos = pos + 1;
- for (sl = 0; isIdentifier( str[rpos + sl].unicode() ); sl++);
+ for (sl = 0; isIdentifier( str[rpos + sl].tqunicode() ); sl++);
rsl = sl + 1;
}
if (!sl)
return 0;
TQMapConstIterator<TQString,VT> it =
- macromap.find( TQConstString( str.unicode() + rpos, sl ).string() );
+ macromap.tqfind( TQConstString( str.tqunicode() + rpos, sl ).string() );
if (it != macromap.end()) {
ret += it.data();
return rsl;
@@ -454,13 +454,13 @@ KCharMacroExpander::expandEscapedMacro( const TQString &str, uint pos, TQStringL
int
KWordMacroExpander::expandPlainMacro( const TQString &str, uint pos, TQStringList &ret )
{
- if (isIdentifier( str[pos - 1].unicode() ))
+ if (isIdentifier( str[pos - 1].tqunicode() ))
return 0;
uint sl;
- for (sl = 0; isIdentifier( str[pos + sl].unicode() ); sl++);
+ for (sl = 0; isIdentifier( str[pos + sl].tqunicode() ); sl++);
if (!sl)
return 0;
- if (expandMacro( TQConstString( str.unicode() + pos, sl ).string(), ret ))
+ if (expandMacro( TQConstString( str.tqunicode() + pos, sl ).string(), ret ))
return sl;
return 0;
}
@@ -481,12 +481,12 @@ KWordMacroExpander::expandEscapedMacro( const TQString &str, uint pos, TQStringL
rsl = sl + 3;
} else {
rpos = pos + 1;
- for (sl = 0; isIdentifier( str[rpos + sl].unicode() ); sl++);
+ for (sl = 0; isIdentifier( str[rpos + sl].tqunicode() ); sl++);
rsl = sl + 1;
}
if (!sl)
return 0;
- if (expandMacro( TQConstString( str.unicode() + rpos, sl ).string(), ret ))
+ if (expandMacro( TQConstString( str.tqunicode() + rpos, sl ).string(), ret ))
return rsl;
return 0;
}