TQt conversion was incomplete in the dcop/idl processors

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1159683 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 229a34d015
commit cb4a5d685b

@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
class QString; class TQString;
#ifndef KDE_USE_FINAL #ifndef KDE_USE_FINAL
#include "yacc.cc.h" #include "yacc.cc.h"
@ -168,10 +168,10 @@ Kidl_Identifier [_a-zA-Z][a-zA-Z0-9_]*
exit( 1 ); exit( 1 );
} }
"#include"[ \t]*[<\"][^>"]*[>\"]\s*\n { "#include"[ \t]*[<\"][^>"]*[>\"]\s*\n {
QString s( yytext ); TQString s( yytext );
int i = s.find(QRegExp("[\"<]"))+1; int i = s.find(TQRegExp("[\"<]"))+1;
int j = s.find(QRegExp("[\">]"), i); int j = s.find(TQRegExp("[\">]"), i);
yylval._str = new QString( s.mid( i, j - i ) ); yylval._str = new TQString( s.mid( i, j - i ) );
idl_line_no++; idl_line_no++;
return T_INCLUDE; return T_INCLUDE;
} }
@ -241,7 +241,7 @@ Q_OBJECT ;
"extern \"C\"" return T_EXTERN_C; "extern \"C\"" return T_EXTERN_C;
{Kidl_Identifier} { {Kidl_Identifier} {
yylval._str = new QString( yytext ); yylval._str = new TQString( yytext );
return T_IDENTIFIER; return T_IDENTIFIER;
} }
@ -266,14 +266,14 @@ Q_OBJECT ;
return T_INTEGER_LITERAL; return T_INTEGER_LITERAL;
} }
{Char_Literal} { {Char_Literal} {
QCString s( yytext ); TQCString s( yytext );
s = s.mid( 1, s.length() - 2 ); s = s.mid( 1, s.length() - 2 );
yylval._char = translate_char( s ); yylval._char = translate_char( s );
return T_CHARACTER_LITERAL; return T_CHARACTER_LITERAL;
} }
{String_Literal} { {String_Literal} {
QString s( yytext ); TQString s( yytext );
yylval._str = new QString( s.mid( 1, s.length() - 2 ) ); yylval._str = new TQString( s.mid( 1, s.length() - 2 ) );
return T_STRING_LITERAL; return T_STRING_LITERAL;
} }
. { . {

@ -277,7 +277,7 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d
str << '\t'<< *ittypes << " " << *args_count << ";" << endl; str << '\t'<< *ittypes << " " << *args_count << ";" << endl;
++ittypes; ++ittypes;
} }
str << "\tQDataStream arg( data, IO_ReadOnly );" << endl; str << "\tTQDataStream arg( data, IO_ReadOnly );" << endl;
for( args_count = args.begin(); args_count != args.end(); ++args_count ){ for( args_count = args.begin(); args_count != args.end(); ++args_count ){
str << "\tif (arg.atEnd()) return false;" << endl; // Basic error checking str << "\tif (arg.atEnd()) return false;" << endl; // Basic error checking
str << "\targ >> " << *args_count << ";" << endl; str << "\targ >> " << *args_count << ";" << endl;
@ -288,7 +288,7 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d
if ( funcType == "void" ) { if ( funcType == "void" ) {
str << '\t' << plainFuncName << '('; str << '\t' << plainFuncName << '(';
} else { } else {
str << "\tQDataStream _replyStream( replyData, IO_WriteOnly );" << endl; str << "\tTQDataStream _replyStream( replyData, IO_WriteOnly );" << endl;
str << "\t_replyStream << " << plainFuncName << '('; str << "\t_replyStream << " << plainFuncName << '(';
} }
@ -360,7 +360,7 @@ void generateSkel( const TQString& idl, const TQString& filename, TQDomElement d
str << "\tif (" << className << "_ftable_hiddens[i])" << endl; str << "\tif (" << className << "_ftable_hiddens[i])" << endl;
str << "\t continue;" << endl; str << "\t continue;" << endl;
} }
str << "\tQCString func = " << className << "_ftable[i][0];" << endl; str << "\tTQCString func = " << className << "_ftable[i][0];" << endl;
str << "\tfunc += ' ';" << endl; str << "\tfunc += ' ';" << endl;
str << "\tfunc += " << className << "_ftable[i][2];" << endl; str << "\tfunc += " << className << "_ftable[i][2];" << endl;
str << "\tfuncs << func;" << endl; str << "\tfuncs << func;" << endl;

@ -160,20 +160,20 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
continue; continue;
nohit: nohit:
if (state.current == singlequote) { if (state.current == singlequote) {
if (cc == '\'') if (cc == (QChar)'\'')
state = sstack.pop(); state = sstack.pop();
} else if (cc == '\\') { } else if (cc == (QChar)'\\') {
// always swallow the char -> prevent anomalies due to expansion // always swallow the char -> prevent anomalies due to expansion
pos += 2; pos += 2;
continue; continue;
} else if (state.current == dollarquote) { } else if (state.current == dollarquote) {
if (cc == '\'') if (cc == (QChar)'\'')
state = sstack.pop(); state = sstack.pop();
} else if (cc == '$') { } else if (cc == (QChar)'$') {
cc = str[++pos]; cc = str[++pos];
if (cc == '(') { if (cc == (QChar)'(') {
sstack.push( state ); sstack.push( state );
if (str[pos + 1] == '(') { if (str[pos + 1] == (QChar)'(') {
Save sav = { str, pos + 2 }; Save sav = { str, pos + 2 };
ostack.push( sav ); ostack.push( sav );
state.current = math; state.current = math;
@ -183,21 +183,21 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
state.current = paren; state.current = paren;
state.dquote = false; state.dquote = false;
} }
} else if (cc == '{') { } else if (cc == (QChar)'{') {
sstack.push( state ); sstack.push( state );
state.current = subst; state.current = subst;
} else if (!state.dquote) { } else if (!state.dquote) {
if (cc == '\'') { if (cc == (QChar)'\'') {
sstack.push( state ); sstack.push( state );
state.current = dollarquote; state.current = dollarquote;
} else if (cc == '"') { } else if (cc == (QChar)'"') {
sstack.push( state ); sstack.push( state );
state.current = doublequote; state.current = doublequote;
state.dquote = true; state.dquote = true;
} }
} }
// always swallow the char -> prevent anomalies due to expansion // always swallow the char -> prevent anomalies due to expansion
} else if (cc == '`') { } else if (cc == (QChar)'`') {
str.replace( pos, 1, "$( " ); // add space -> avoid creating $(( str.replace( pos, 1, "$( " ); // add space -> avoid creating $((
pos2 = pos += 3; pos2 = pos += 3;
for (;;) { for (;;) {
@ -206,12 +206,12 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
return false; return false;
} }
cc = str.unicode()[pos2]; cc = str.unicode()[pos2];
if (cc == '`') if (cc == (QChar)'`')
break; break;
if (cc == '\\') { if (cc == (QChar)'\\') {
cc = str[++pos2]; cc = str[++pos2];
if (cc == '$' || cc == '`' || cc == '\\' || if (cc == (QChar)'$' || cc == (QChar)'`' || cc == (QChar)'\\' ||
(cc == '"' && state.dquote)) (cc == (QChar)'"' && state.dquote))
{ {
str.remove( pos2 - 1, 1 ); str.remove( pos2 - 1, 1 );
continue; continue;
@ -225,25 +225,25 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
state.dquote = false; state.dquote = false;
continue; continue;
} else if (state.current == doublequote) { } else if (state.current == doublequote) {
if (cc == '"') if (cc == (QChar)'"')
state = sstack.pop(); state = sstack.pop();
} else if (cc == '\'') { } else if (cc == (QChar)'\'') {
if (!state.dquote) { if (!state.dquote) {
sstack.push( state ); sstack.push( state );
state.current = singlequote; state.current = singlequote;
} }
} else if (cc == '"') { } else if (cc == (QChar)'"') {
if (!state.dquote) { if (!state.dquote) {
sstack.push( state ); sstack.push( state );
state.current = doublequote; state.current = doublequote;
state.dquote = true; state.dquote = true;
} }
} else if (state.current == subst) { } else if (state.current == subst) {
if (cc == '}') if (cc == (QChar)'}')
state = sstack.pop(); state = sstack.pop();
} else if (cc == ')') { } else if (cc == (QChar)')') {
if (state.current == math) { if (state.current == math) {
if (str[pos + 1] == ')') { if (str[pos + 1] == (QChar)')') {
state = sstack.pop(); state = sstack.pop();
pos += 2; pos += 2;
} else { } else {
@ -261,15 +261,15 @@ bool KMacroExpanderBase::expandMacrosShellQuote( TQString &str, uint &pos )
state = sstack.pop(); state = sstack.pop();
else else
break; break;
} else if (cc == '}') { } else if (cc == (QChar)'}') {
if (state.current == KMacroExpander::group) if (state.current == KMacroExpander::group)
state = sstack.pop(); state = sstack.pop();
else else
break; break;
} else if (cc == '(') { } else if (cc == (QChar)'(') {
sstack.push( state ); sstack.push( state );
state.current = paren; state.current = paren;
} else if (cc == '{') { } else if (cc == (QChar)'{') {
sstack.push( state ); sstack.push( state );
state.current = KMacroExpander::group; state.current = KMacroExpander::group;
} }
@ -315,7 +315,7 @@ static TQStringList &operator+=( TQStringList &s, const TQString &n) { s << n; r
static bool static bool
isIdentifier( uint c ) isIdentifier( uint c )
{ {
return c == '_' || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); return c == (QChar)'_' || (c >= (QChar)'A' && c <= (QChar)'Z') || (c >= (QChar)'a' && c <= (QChar)'z') || (c >= (QChar)'0' && c <= (QChar)'9');
} }
//////// ////////
@ -407,9 +407,9 @@ KMacroMapExpander<TQString,VT>::expandEscapedMacro( const TQString &str, uint po
return 2; return 2;
} }
uint sl, rsl, rpos; uint sl, rsl, rpos;
if (str[pos + 1] == '{') { if (str[pos + 1] == (QChar)'{') {
rpos = pos + 2; rpos = pos + 2;
for (sl = 0; str[rpos + sl] != '}'; sl++) for (sl = 0; str[rpos + sl] != (QChar)'}'; sl++)
if (rpos + sl >= str.length()) if (rpos + sl >= str.length())
return 0; return 0;
rsl = sl + 3; rsl = sl + 3;
@ -473,9 +473,9 @@ KWordMacroExpander::expandEscapedMacro( const TQString &str, uint pos, TQStringL
return 2; return 2;
} }
uint sl, rsl, rpos; uint sl, rsl, rpos;
if (str[pos + 1] == '{') { if (str[pos + 1] == (QChar)'{') {
rpos = pos + 2; rpos = pos + 2;
for (sl = 0; str[rpos + sl] != '}'; sl++) for (sl = 0; str[rpos + sl] != (QChar)'}'; sl++)
if (rpos + sl >= str.length()) if (rpos + sl >= str.length())
return 0; return 0;
rsl = sl + 3; rsl = sl + 3;

@ -29,12 +29,12 @@
static int fromHex( TQChar c ) static int fromHex( TQChar c )
{ {
if (c >= '0' && c <= '9') if (c >= (QChar)'0' && c <= (QChar)'9')
return c - '0'; return c - (QChar)'0';
else if (c >= 'A' && c <= 'F') else if (c >= (QChar)'A' && c <= (QChar)'F')
return c - 'A' + 10; return c - (QChar)'A' + 10;
else if (c >= 'a' && c <= 'f') else if (c >= (QChar)'a' && c <= (QChar)'f')
return c - 'a' + 10; return c - (QChar)'a' + 10;
return -1; return -1;
} }
@ -48,7 +48,7 @@ inline static bool isQuoteMeta( uint c )
return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7))); return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7)));
#else #else
return c == '\\' || c == '\'' || c == '"' || c == '$'; return c == (int)'\\' || c == (int)'\'' || c == (int)'"' || c == (int)'$';
#endif #endif
} }
@ -75,17 +75,17 @@ TQStringList KShell::splitArgs( const TQString &args, int flags, int *err )
c = args.unicode()[pos++]; c = args.unicode()[pos++];
} while (c.isSpace()); } while (c.isSpace());
TQString cret; TQString cret;
if ((flags & TildeExpand) && c == '~') { if ((flags & TildeExpand) && c == (QChar)'~') {
uint opos = pos; uint opos = pos;
for (; ; pos++) { for (; ; pos++) {
if (pos >= args.length()) if (pos >= args.length())
break; break;
c = args.unicode()[pos]; c = args.unicode()[pos];
if (c == '/' || c.isSpace()) if (c == (QChar)'/' || c.isSpace())
break; break;
if (isQuoteMeta( c )) { if (isQuoteMeta( c )) {
pos = opos; pos = opos;
c = '~'; c = (QChar)'~';
goto notilde; goto notilde;
} }
if ((flags & AbortOnMeta) && isMeta( c )) if ((flags & AbortOnMeta) && isMeta( c ))
@ -94,7 +94,7 @@ TQStringList KShell::splitArgs( const TQString &args, int flags, int *err )
TQString ccret = homeDir( TQConstString( args.unicode() + opos, pos - opos ).string() ); TQString ccret = homeDir( TQConstString( args.unicode() + opos, pos - opos ).string() );
if (ccret.isEmpty()) { if (ccret.isEmpty()) {
pos = opos; pos = opos;
c = '~'; c = (QChar)'~';
goto notilde; goto notilde;
} }
if (pos >= args.length()) { if (pos >= args.length()) {
@ -111,67 +111,67 @@ TQStringList KShell::splitArgs( const TQString &args, int flags, int *err )
} }
// before the notilde label, as a tilde does not match anyway // before the notilde label, as a tilde does not match anyway
if (firstword) { if (firstword) {
if (c == '_' || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) { if (c == (QChar)'_' || (c >= (QChar)'A' && c <= (QChar)'Z') || (c >= (QChar)'a' && c <= (QChar)'z')) {
uint pos2 = pos; uint pos2 = pos;
TQChar cc; TQChar cc;
do do
cc = args[pos2++]; cc = args[pos2++];
while (cc == '_' || (cc >= 'A' && cc <= 'Z') || while (cc == (QChar)'_' || (cc >= (QChar)'A' && cc <= (QChar)'Z') ||
(cc >= 'a' && cc <= 'z') || (cc >= '0' && cc <= '9')); (cc >= (QChar)'a' && cc <= (QChar)'z') || (cc >= (QChar)'0' && cc <= (QChar)'9'));
if (cc == '=') if (cc == (QChar)'=')
goto metaerr; goto metaerr;
} }
} }
notilde: notilde:
do { do {
if (c == '\'') { if (c == (QChar)'\'') {
uint spos = pos; uint spos = pos;
do { do {
if (pos >= args.length()) if (pos >= args.length())
goto quoteerr; goto quoteerr;
c = args.unicode()[pos++]; c = args.unicode()[pos++];
} while (c != '\''); } while (c != (QChar)'\'');
cret += TQConstString( args.unicode() + spos, pos - spos - 1 ).string(); cret += TQConstString( args.unicode() + spos, pos - spos - 1 ).string();
} else if (c == '"') { } else if (c == (QChar)'"') {
for (;;) { for (;;) {
if (pos >= args.length()) if (pos >= args.length())
goto quoteerr; goto quoteerr;
c = args.unicode()[pos++]; c = args.unicode()[pos++];
if (c == '"') if (c == (QChar)'"')
break; break;
if (c == '\\') { if (c == (QChar)'\\') {
if (pos >= args.length()) if (pos >= args.length())
goto quoteerr; goto quoteerr;
c = args.unicode()[pos++]; c = args.unicode()[pos++];
if (c != '"' && c != '\\' && if (c != (QChar)'"' && c != (QChar)'\\' &&
!((flags & AbortOnMeta) && (c == '$' || c == '`'))) !((flags & AbortOnMeta) && (c == (QChar)'$' || c == (QChar)'`')))
cret += '\\'; cret += (QChar)'\\';
} else if ((flags & AbortOnMeta) && (c == '$' || c == '`')) } else if ((flags & AbortOnMeta) && (c == (QChar)'$' || c == (QChar)'`'))
goto metaerr; goto metaerr;
cret += c; cret += c;
} }
} else if (c == '$' && args[pos] == '\'') { } else if (c == (QChar)'$' && args[pos] == (QChar)'\'') {
pos++; pos++;
for (;;) { for (;;) {
if (pos >= args.length()) if (pos >= args.length())
goto quoteerr; goto quoteerr;
c = args.unicode()[pos++]; c = args.unicode()[pos++];
if (c == '\'') if (c == (QChar)'\'')
break; break;
if (c == '\\') { if (c == (QChar)'\\') {
if (pos >= args.length()) if (pos >= args.length())
goto quoteerr; goto quoteerr;
c = args.unicode()[pos++]; c = args.unicode()[pos++];
switch (c) { switch (c) {
case 'a': cret += '\a'; break; case 'a': cret += (QChar)'\a'; break;
case 'b': cret += '\b'; break; case 'b': cret += (QChar)'\b'; break;
case 'e': cret += '\033'; break; case 'e': cret += (QChar)'\033'; break;
case 'f': cret += '\f'; break; case 'f': cret += (QChar)'\f'; break;
case 'n': cret += '\n'; break; case 'n': cret += (QChar)'\n'; break;
case 'r': cret += '\r'; break; case 'r': cret += (QChar)'\r'; break;
case 't': cret += '\t'; break; case 't': cret += (QChar)'\t'; break;
case '\\': cret += '\\'; break; case '\\': cret += (QChar)'\\'; break;
case '\'': cret += '\''; break; case '\'': cret += (QChar)'\''; break;
case 'c': cret += args[pos++] & 31; break; case 'c': cret += args[pos++] & 31; break;
case 'x': case 'x':
{ {
@ -189,11 +189,11 @@ TQStringList KShell::splitArgs( const TQString &args, int flags, int *err )
break; break;
} }
default: default:
if (c >= '0' && c <= '7') { if (c >= (QChar)'0' && c <= (QChar)'7') {
int hv = c - '0'; int hv = c - '0';
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
c = args[pos]; c = args[pos];
if (c < '0' || c > '7') if (c < (QChar)'0' || c > (QChar)'7')
break; break;
hv = hv * 8 + (c - '0'); hv = hv * 8 + (c - '0');
pos++; pos++;
@ -209,7 +209,7 @@ TQStringList KShell::splitArgs( const TQString &args, int flags, int *err )
cret += c; cret += c;
} }
} else { } else {
if (c == '\\') { if (c == (QChar)'\\') {
if (pos >= args.length()) if (pos >= args.length())
goto quoteerr; goto quoteerr;
c = args.unicode()[pos++]; c = args.unicode()[pos++];
@ -354,7 +354,7 @@ TQString KShell::joinArgsDQ( const TQStringList &args )
TQString KShell::tildeExpand( const TQString &fname ) TQString KShell::tildeExpand( const TQString &fname )
{ {
if (fname[0] == '~') { if (fname[0] == (QChar)'~') {
int pos = fname.find( '/' ); int pos = fname.find( '/' );
if (pos < 0) if (pos < 0)
return homeDir( TQConstString( fname.unicode() + 1, fname.length() - 1 ).string() ); return homeDir( TQConstString( fname.unicode() + 1, fname.length() - 1 ).string() );

Loading…
Cancel
Save