summaryrefslogtreecommitdiffstats
path: root/tdecore/kmacroexpander.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/kmacroexpander.cpp')
-rw-r--r--tdecore/kmacroexpander.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/tdecore/kmacroexpander.cpp b/tdecore/kmacroexpander.cpp
index 9cfddcc63..a2ece0a40 100644
--- a/tdecore/kmacroexpander.cpp
+++ b/tdecore/kmacroexpander.cpp
@@ -55,7 +55,7 @@ void KMacroExpanderBase::expandMacros( TQString &str )
TQString rsts;
for (pos = 0; pos < str.length(); ) {
- if (ec != (QChar)0) {
+ if (ec != (TQChar)0) {
if (str.unicode()[pos] != ec)
goto nohit;
if (!(len = expandEscapedMacro( str, pos, rst )))
@@ -110,7 +110,7 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
while (pos < str.length()) {
TQChar cc( str.unicode()[pos] );
- if (ec != (QChar)0) {
+ if (ec != (TQChar)0) {
if (cc != ec)
goto nohit;
if (!(len = expandEscapedMacro( str, pos, rst )))
@@ -160,20 +160,20 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
continue;
nohit:
if (state.current == singlequote) {
- if (cc == (QChar)'\'')
+ if (cc == (TQChar)'\'')
state = sstack.pop();
- } else if (cc == (QChar)'\\') {
+ } else if (cc == (TQChar)'\\') {
// always swallow the char -> prevent anomalies due to expansion
pos += 2;
continue;
} else if (state.current == dollarquote) {
- if (cc == (QChar)'\'')
+ if (cc == (TQChar)'\'')
state = sstack.pop();
- } else if (cc == (QChar)'$') {
+ } else if (cc == (TQChar)'$') {
cc = str[++pos];
- if (cc == (QChar)'(') {
+ if (cc == (TQChar)'(') {
sstack.push( state );
- if (str[pos + 1] == (QChar)'(') {
+ if (str[pos + 1] == (TQChar)'(') {
Save sav = { str, pos + 2 };
ostack.push( sav );
state.current = math;
@@ -183,21 +183,21 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
state.current = paren;
state.dquote = false;
}
- } else if (cc == (QChar)'{') {
+ } else if (cc == (TQChar)'{') {
sstack.push( state );
state.current = subst;
} else if (!state.dquote) {
- if (cc == (QChar)'\'') {
+ if (cc == (TQChar)'\'') {
sstack.push( state );
state.current = dollarquote;
- } else if (cc == (QChar)'"') {
+ } else if (cc == (TQChar)'"') {
sstack.push( state );
state.current = doublequote;
state.dquote = true;
}
}
// always swallow the char -> prevent anomalies due to expansion
- } else if (cc == (QChar)'`') {
+ } else if (cc == (TQChar)'`') {
str.replace( pos, 1, "$( " ); // add space -> avoid creating $((
pos2 = pos += 3;
for (;;) {
@@ -206,12 +206,12 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
return false;
}
cc = str.unicode()[pos2];
- if (cc == (QChar)'`')
+ if (cc == (TQChar)'`')
break;
- if (cc == (QChar)'\\') {
+ if (cc == (TQChar)'\\') {
cc = str[++pos2];
- if (cc == (QChar)'$' || cc == (QChar)'`' || cc == (QChar)'\\' ||
- (cc == (QChar)'"' && state.dquote))
+ if (cc == (TQChar)'$' || cc == (TQChar)'`' || cc == (TQChar)'\\' ||
+ (cc == (TQChar)'"' && state.dquote))
{
str.remove( pos2 - 1, 1 );
continue;
@@ -225,25 +225,25 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
state.dquote = false;
continue;
} else if (state.current == doublequote) {
- if (cc == (QChar)'"')
+ if (cc == (TQChar)'"')
state = sstack.pop();
- } else if (cc == (QChar)'\'') {
+ } else if (cc == (TQChar)'\'') {
if (!state.dquote) {
sstack.push( state );
state.current = singlequote;
}
- } else if (cc == (QChar)'"') {
+ } else if (cc == (TQChar)'"') {
if (!state.dquote) {
sstack.push( state );
state.current = doublequote;
state.dquote = true;
}
} else if (state.current == subst) {
- if (cc == (QChar)'}')
+ if (cc == (TQChar)'}')
state = sstack.pop();
- } else if (cc == (QChar)')') {
+ } else if (cc == (TQChar)')') {
if (state.current == math) {
- if (str[pos + 1] == (QChar)')') {
+ if (str[pos + 1] == (TQChar)')') {
state = sstack.pop();
pos += 2;
} else {
@@ -261,15 +261,15 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
state = sstack.pop();
else
break;
- } else if (cc == (QChar)'}') {
+ } else if (cc == (TQChar)'}') {
if (state.current == KMacroExpander::group)
state = sstack.pop();
else
break;
- } else if (cc == (QChar)'(') {
+ } else if (cc == (TQChar)'(') {
sstack.push( state );
state.current = paren;
- } else if (cc == (QChar)'{') {
+ } else if (cc == (TQChar)'{') {
sstack.push( state );
state.current = KMacroExpander::group;
}
@@ -407,9 +407,9 @@ KMacroMapExpander<TQString,VT>::expandEscapedMacro( const TQString &str, uint po
return 2;
}
uint sl, rsl, rpos;
- if (str[pos + 1] == (QChar)'{') {
+ if (str[pos + 1] == (TQChar)'{') {
rpos = pos + 2;
- for (sl = 0; str[rpos + sl] != (QChar)'}'; sl++)
+ for (sl = 0; str[rpos + sl] != (TQChar)'}'; sl++)
if (rpos + sl >= str.length())
return 0;
rsl = sl + 3;
@@ -473,9 +473,9 @@ KWordMacroExpander::expandEscapedMacro( const TQString &str, uint pos, TQStringL
return 2;
}
uint sl, rsl, rpos;
- if (str[pos + 1] == (QChar)'{') {
+ if (str[pos + 1] == (TQChar)'{') {
rpos = pos + 2;
- for (sl = 0; str[rpos + sl] != (QChar)'}'; sl++)
+ for (sl = 0; str[rpos + sl] != (TQChar)'}'; sl++)
if (rpos + sl >= str.length())
return 0;
rsl = sl + 3;
@@ -494,7 +494,7 @@ KWordMacroExpander::expandEscapedMacro( const TQString &str, uint pos, TQStringL
////////////
template<class KT,class VT>
-inline QString
+inline TQString
TexpandMacros( const TQString &ostr, const TQMap<KT,VT> &map, TQChar c )
{
TQString str( ostr );
@@ -504,7 +504,7 @@ TexpandMacros( const TQString &ostr, const TQMap<KT,VT> &map, TQChar c )
}
template<class KT,class VT>
-inline QString
+inline TQString
TexpandMacrosShellQuote( const TQString &ostr, const TQMap<KT,VT> &map, TQChar c )
{
TQString str( ostr );