diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /dcop/client | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'dcop/client')
-rw-r--r-- | dcop/client/dcop.cpp | 136 | ||||
-rw-r--r-- | dcop/client/dcopfind.cpp | 62 | ||||
-rw-r--r-- | dcop/client/dcopstart.cpp | 30 | ||||
-rw-r--r-- | dcop/client/marshall.cpp | 148 |
4 files changed, 188 insertions, 188 deletions
diff --git a/dcop/client/dcop.cpp b/dcop/client/dcop.cpp index e8fd7683a..a78c8e016 100644 --- a/dcop/client/dcop.cpp +++ b/dcop/client/dcop.cpp @@ -30,16 +30,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <stdio.h> #include <stdlib.h> -#include <qbuffer.h> -#include <qcolor.h> -#include <qdir.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qimage.h> -#include <qmap.h> -#include <qstringlist.h> -#include <qtextstream.h> -#include <qvariant.h> +#include <tqbuffer.h> +#include <tqcolor.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqimage.h> +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqtextstream.h> +#include <tqvariant.h> #include "../dcopclient.h" #include "../dcopref.h" @@ -52,13 +52,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <X11/Xatom.h> #endif -typedef QMap<QString, QString> UserList; +typedef TQMap<TQString, TQString> UserList; static DCOPClient* dcop = 0; -static QTextStream cin_ ( stdin, IO_ReadOnly ); -static QTextStream cout_( stdout, IO_WriteOnly ); -static QTextStream cerr_( stderr, IO_WriteOnly ); +static TQTextStream cin_ ( stdin, IO_ReadOnly ); +static TQTextStream cout_( stdout, IO_WriteOnly ); +static TQTextStream cerr_( stderr, IO_WriteOnly ); /** * Session to send call to @@ -71,12 +71,12 @@ static QTextStream cerr_( stderr, IO_WriteOnly ); */ enum Session { DefaultSession = 0, AllSessions, QuerySessions, CustomSession }; -bool startsWith(const QCString &id, const char *str, int n) +bool startsWith(const TQCString &id, const char *str, int n) { return !n || (strncmp(id.data(), str, n) == 0); } -bool endsWith(QCString &id, char c) +bool endsWith(TQCString &id, char c) { if (id.length() && (id[id.length()-1] == c)) { @@ -86,13 +86,13 @@ bool endsWith(QCString &id, char c) return false; } -void queryApplications(const QCString &filter) +void queryApplications(const TQCString &filter) { int filterLen = filter.length(); QCStringList apps = dcop->registeredApplications(); for ( QCStringList::Iterator it = apps.begin(); it != apps.end(); ++it ) { - QCString &clientId = *it; + TQCString &clientId = *it; if ( (clientId != dcop->appId()) && !startsWith(clientId, "anonymous",9) && startsWith(clientId, filter, filterLen) @@ -107,7 +107,7 @@ void queryApplications(const QCString &filter) } } -void queryObjects( const QCString &app, const QCString &filter ) +void queryObjects( const TQCString &app, const TQCString &filter ) { int filterLen = filter.length(); bool ok = false; @@ -115,7 +115,7 @@ void queryObjects( const QCString &app, const QCString &filter ) QCStringList objs = dcop->remoteObjects( app, &ok ); for ( QCStringList::Iterator it = objs.begin(); it != objs.end(); ++it ) { - QCString &objId = *it; + TQCString &objId = *it; if (objId == "default") { @@ -158,7 +158,7 @@ void queryFunctions( const char* app, const char* obj ) int callFunction( const char* app, const char* obj, const char* func, const QCStringList args ) { - QString f = func; // Qt is better with unicode strings, so use one. + TQString f = func; // Qt is better with unicode strings, so use one. int left = f.find( '(' ); int right = f.find( ')' ); @@ -172,7 +172,7 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt // try to get the interface from the server bool ok = false; QCStringList funcs = dcop->remoteFunctions( app, obj, &ok ); - QCString realfunc; + TQCString realfunc; if ( !ok && args.isEmpty() ) goto doit; if ( !ok ) @@ -195,7 +195,7 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt if ( l > 0 && (*it).mid( s, l - s ) == func ) { realfunc = (*it).mid( s ); - const QString arguments = (*it).mid(l+1,(*it).find( ')' )-l-1); + const TQString arguments = (*it).mid(l+1,(*it).find( ')' )-l-1); uint a = arguments.contains(','); if ( (a==0 && !arguments.isEmpty()) || a>0) a++; @@ -221,26 +221,26 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt // of dcop, so it should be OK. // // - QStringList intTypes; + TQStringList intTypes; intTypes << "int" << "unsigned" << "long" << "bool" ; - QStringList types; + TQStringList types; if ( left >0 && left + 1 < right - 1) { - types = QStringList::split( ',', f.mid( left + 1, right - left - 1) ); - for ( QStringList::Iterator it = types.begin(); it != types.end(); ++it ) { - QString lt = (*it).simplifyWhiteSpace(); + types = TQStringList::split( ',', f.mid( left + 1, right - left - 1) ); + for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { + TQString lt = (*it).simplifyWhiteSpace(); int s = lt.find(' '); // If there are spaces in the name, there may be two // reasons: the parameter name is still there, ie. - // "QString URL" or it's a complicated int type, ie. + // "TQString URL" or it's a complicated int type, ie. // "unsigned long long int bool". // // if ( s > 0 ) { - QStringList partl = QStringList::split(' ' , lt); + TQStringList partl = TQStringList::split(' ' , lt); // The zero'th part is -- at the very least -- a // type part. Any trailing parts *might* be extra @@ -271,10 +271,10 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt (*it) = lt; } - QString fc = f.left( left ); + TQString fc = f.left( left ); fc += '('; bool first = true; - for ( QStringList::Iterator it = types.begin(); it != types.end(); ++it ) { + for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { if ( !first ) fc +=","; first = false; @@ -284,12 +284,12 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt f = fc; } - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); uint i = 0; - for( QStringList::Iterator it = types.begin(); it != types.end(); ++it ) + for( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) marshall( arg, args, i, *it ); if ( i != args.count() ) @@ -302,11 +302,11 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt qWarning( "call failed"); return( 1 ); } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if ( replyType != "void" && replyType != "ASYNC" ) { - QCString replyString = demarshal( reply, replyType ); + TQCString replyString = demarshal( reply, replyType ); if ( !replyString.isEmpty() ) printf( "%s\n", replyString.data() ); else @@ -380,7 +380,7 @@ static UserList userList() while( passwd* pstruct = getpwent() ) { - result[ QString::fromLocal8Bit(pstruct->pw_name) ] = QFile::decodeName(pstruct->pw_dir); + result[ TQString::fromLocal8Bit(pstruct->pw_name) ] = TQFile::decodeName(pstruct->pw_dir); } return result; @@ -390,7 +390,7 @@ static UserList userList() * Return a list of available DCOP sessions for the specified user * An empty list means no sessions are available, or an error occurred. */ -QStringList dcopSessionList( const QString &user, const QString &home ) +TQStringList dcopSessionList( const TQString &user, const TQString &home ) { if( home.isEmpty() ) { @@ -398,16 +398,16 @@ QStringList dcopSessionList( const QString &user, const QString &home ) << user << "!" << endl << "Please check permissions or set the $DCOPSERVER variable manually before" << endl << "calling dcop." << endl; - return QStringList(); + return TQStringList(); } - QStringList result; - QFileInfo dirInfo( home ); + TQStringList result; + TQFileInfo dirInfo( home ); if( !dirInfo.exists() || !dirInfo.isReadable() ) return result; - QDir d( home ); - d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); + TQDir d( home ); + d.setFilter( TQDir::Files | TQDir::Hidden | TQDir::NoSymLinks ); d.setNameFilter( ".DCOPserver*" ); const QFileInfoList *list = d.entryInfoList(); @@ -415,7 +415,7 @@ QStringList dcopSessionList( const QString &user, const QString &home ) return result; QFileInfoListIterator it( *list ); - QFileInfo *fi; + TQFileInfo *fi; while ( ( fi = it.current() ) != 0 ) { @@ -455,12 +455,12 @@ void sendUserTime( const char* app ) * Do the actual DCOP call */ int runDCOP( QCStringList args, UserList users, Session session, - const QString sessionName, bool readStdin, bool updateUserTime ) + const TQString sessionName, bool readStdin, bool updateUserTime ) { bool DCOPrefmode=false; - QCString app; - QCString objid; - QCString function; + TQCString app; + TQCString objid; + TQCString function; QCStringList params; DCOPClient *client = 0L; int retval = 0; @@ -505,10 +505,10 @@ int runDCOP( QCStringList args, UserList users, Session session, bool firstRun = true; UserList::Iterator it; - QStringList sessions; + TQStringList sessions; bool presetDCOPServer = false; // char *dcopStr = 0L; - QString dcopServer; + TQString dcopServer; for( it = users.begin(); it != users.end() || firstRun; ++it ) { @@ -518,7 +518,7 @@ int runDCOP( QCStringList args, UserList users, Session session, if( session == QuerySessions ) { - QStringList sessions = dcopSessionList( it.key(), it.data() ); + TQStringList sessions = dcopSessionList( it.key(), it.data() ); if( sessions.isEmpty() ) { if( users.count() <= 1 ) @@ -536,7 +536,7 @@ int runDCOP( QCStringList args, UserList users, Session session, cout_ << "for user " << *it << " "; cout_ << ":" << endl; - QStringList::Iterator sIt = sessions.begin(); + TQStringList::Iterator sIt = sessions.begin(); for( ; sIt != sessions.end(); ++sIt ) cout_ << " " << *sIt << endl; @@ -593,9 +593,9 @@ int runDCOP( QCStringList args, UserList users, Session session, ( getenv( "ICEAUTHORITY" ) == 0 || getenv( "DISPLAY" ) == 0 ) ) ) { // Check for ICE authority file and if the file can be read by us - QString home = it.data(); - QString iceFile = it.data() + "/.ICEauthority"; - QFileInfo fi( iceFile ); + TQString home = it.data(); + TQString iceFile = it.data() + "/.ICEauthority"; + TQFileInfo fi( iceFile ); if( iceFile.isEmpty() ) { cerr_ << "WARNING: Cannot determine home directory for user " @@ -638,20 +638,20 @@ int runDCOP( QCStringList args, UserList users, Session session, // If users is an empty list we're calling for the currently logged // in user. In this case we don't have a session, but still want // to iterate the loop once. - QStringList::Iterator sIt = sessions.begin(); + TQStringList::Iterator sIt = sessions.begin(); for( ; sIt != sessions.end() || users.isEmpty(); ++sIt ) { if( !presetDCOPServer && !users.isEmpty() ) { - QString dcopFile = it.data() + "/" + *sIt; - QFile f( dcopFile ); + TQString dcopFile = it.data() + "/" + *sIt; + TQFile f( dcopFile ); if( !f.open( IO_ReadOnly ) ) { cerr_ << "Can't open " << dcopFile << " for reading!" << endl; exit( -1 ); } - QStringList l( QStringList::split( '\n', f.readAll() ) ); + TQStringList l( TQStringList::split( '\n', f.readAll() ) ); dcopServer = l.first(); if( dcopServer.isEmpty() ) @@ -717,7 +717,7 @@ int runDCOP( QCStringList args, UserList users, Session session, // read line while ( !cin_.atEnd() ) { - QString buf = cin_.readLine(); + TQString buf = cin_.readLine(); if( replaceArg != params.end() ) *replaceArg = buf.local8Bit(); @@ -759,12 +759,12 @@ int main( int argc, char** argv ) { bool readStdin = false; int numOptions = 0; - QString user; + TQString user; Session session = DefaultSession; - QString sessionName; + TQString sessionName; bool updateUserTime = true; - cin_.setEncoding( QTextStream::Locale ); + cin_.setEncoding( TQTextStream::Locale ); // Scan for command-line options first for( int pos = 1 ; pos <= argc - 1 ; pos++ ) @@ -780,7 +780,7 @@ int main( int argc, char** argv ) { if( pos <= argc - 2 ) { - user = QString::fromLocal8Bit( argv[ pos + 1] ); + user = TQString::fromLocal8Bit( argv[ pos + 1] ); numOptions +=2; pos++; } @@ -799,7 +799,7 @@ int main( int argc, char** argv ) } else if( pos <= argc - 2 ) { - sessionName = QString::fromLocal8Bit( argv[ pos + 1] ); + sessionName = TQString::fromLocal8Bit( argv[ pos + 1] ); numOptions +=2; pos++; } @@ -851,7 +851,7 @@ int main( int argc, char** argv ) #ifdef DCOPQUIT if (argc > 1) { - QCString prog = argv[ numOptions + 1 ]; + TQCString prog = argv[ numOptions + 1 ]; if (!prog.isEmpty()) { diff --git a/dcop/client/dcopfind.cpp b/dcop/client/dcopfind.cpp index 4f69f848f..cd3e4d517 100644 --- a/dcop/client/dcopfind.cpp +++ b/dcop/client/dcopfind.cpp @@ -21,10 +21,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <qbuffer.h> -#include <qvariant.h> -#include <qcolor.h> -#include <qimage.h> +#include <tqbuffer.h> +#include <tqvariant.h> +#include <tqcolor.h> +#include <tqimage.h> #include "../kdatastream.h" #include "../dcopclient.h" #include "../dcopref.h" @@ -40,7 +40,7 @@ static bool bLaunchApp = 0; bool findObject( const char* app, const char* obj, const char* func, QCStringList args ) { - QString f = func; // Qt is better with unicode strings, so use one. + TQString f = func; // Qt is better with unicode strings, so use one. int left = f.find( '(' ); int right = f.find( ')' ); @@ -57,26 +57,26 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis // of dcop, so it should be OK. // // - QStringList intTypes; + TQStringList intTypes; intTypes << "int" << "unsigned" << "long" << "bool" ; - QStringList types; + TQStringList types; if ( left >0 && left + 1 < right - 1) { - types = QStringList::split( ',', f.mid( left + 1, right - left - 1) ); - for ( QStringList::Iterator it = types.begin(); it != types.end(); ++it ) { - QString lt = (*it).simplifyWhiteSpace(); + types = TQStringList::split( ',', f.mid( left + 1, right - left - 1) ); + for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { + TQString lt = (*it).simplifyWhiteSpace(); int s = lt.find(' '); // If there are spaces in the name, there may be two // reasons: the parameter name is still there, ie. - // "QString URL" or it's a complicated int type, ie. + // "TQString URL" or it's a complicated int type, ie. // "unsigned long long int bool". // // if ( s > 0 ) { - QStringList partl = QStringList::split(' ' , lt); + TQStringList partl = TQStringList::split(' ' , lt); // The zero'th part is -- at the very least -- a // type part. Any trailing parts *might* be extra @@ -107,10 +107,10 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis (*it) = lt; } - QString fc = f.left( left ); + TQString fc = f.left( left ); fc += '('; bool first = true; - for ( QStringList::Iterator it = types.begin(); it != types.end(); ++it ) { + for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { if ( !first ) fc +=","; first = false; @@ -125,11 +125,11 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis exit(1); } - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); uint i = 0; - for ( QStringList::Iterator it = types.begin(); it != types.end(); ++it ) { + for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) { marshall(arg, args, i, *it); } if ( (uint) i != args.count() ) { @@ -137,8 +137,8 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis exit(1); } - QCString foundApp; - QCString foundObj; + TQCString foundApp; + TQCString foundObj; if ( dcop->findObject( app, obj, f.latin1(), data, foundApp, foundObj) ) { if (bAppIdOnly) @@ -150,7 +150,7 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis return false; } -bool launchApp(QString app) +bool launchApp(TQString app) { int l = app.length(); if (l && (app[l-1] == '*')) @@ -160,18 +160,18 @@ bool launchApp(QString app) if (!l) return false; app.truncate(l); - QStringList URLs; - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQStringList URLs; + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << app << URLs; - if ( !dcop->call( "klauncher", "klauncher", "start_service_by_desktop_name(QString,QStringList)", + if ( !dcop->call( "klauncher", "klauncher", "start_service_by_desktop_name(TQString,TQStringList)", data, replyType, replyData) ) { qWarning( "call to klauncher failed."); return false; } - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if ( replyType != "serviceResult" ) { @@ -179,8 +179,8 @@ bool launchApp(QString app) return false; } int result; - QCString dcopName; - QString error; + TQCString dcopName; + TQString error; reply >> result >> dcopName >> error; if (result != 0) { @@ -226,9 +226,9 @@ int main( int argc, char** argv ) client.attach(); dcop = &client; - QCString app; - QCString objid; - QCString function; + TQCString app; + TQCString objid; + TQCString function; char **args = 0; if ((argc > argi) && (strncmp(argv[argi], "DCOPRef(", 8)) == 0) { diff --git a/dcop/client/dcopstart.cpp b/dcop/client/dcopstart.cpp index 2b870964f..5741ef775 100644 --- a/dcop/client/dcopstart.cpp +++ b/dcop/client/dcopstart.cpp @@ -26,34 +26,34 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <stdio.h> #include <ctype.h> -#include <qstringlist.h> +#include <tqstringlist.h> static DCOPClient* dcop = 0; void startApp(const char *_app, int argc, const char **args) { const char *function = 0; - QString app = QString::fromLatin1(_app); + TQString app = TQString::fromLatin1(_app); if (app.endsWith(".desktop")) - function = "start_service_by_desktop_path(QString,QStringList)"; + function = "start_service_by_desktop_path(TQString,TQStringList)"; else - function = "start_service_by_desktop_name(QString,QStringList)"; - QStringList URLs; + function = "start_service_by_desktop_name(TQString,TQStringList)"; + TQStringList URLs; for(int i = 0; i < argc; i++) { - URLs.append(QString::fromLocal8Bit(args[i])); + URLs.append(TQString::fromLocal8Bit(args[i])); } - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << app << URLs; if ( !dcop->call( "klauncher", "klauncher", function, data, replyType, replyData) ) { qWarning( "call failed"); exit(1); } else { - QDataStream reply(replyData, IO_ReadOnly); + TQDataStream reply(replyData, IO_ReadOnly); if ( replyType != "serviceResult" ) { @@ -61,8 +61,8 @@ void startApp(const char *_app, int argc, const char **args) exit(1); } int result; - QCString dcopName; - QString error; + TQCString dcopName; + TQString error; reply >> result >> dcopName >> error; if (result != 0) { @@ -89,9 +89,9 @@ int main( int argc, char** argv ) client.attach(); dcop = &client; - QCString app; - QCString objid; - QCString function; + TQCString app; + TQCString objid; + TQCString function; /*char **args = 0;*/ startApp( argv[1], argc - 2, (const char**)&argv[2] ); diff --git a/dcop/client/marshall.cpp b/dcop/client/marshall.cpp index d7d5c260a..f9b7955f2 100644 --- a/dcop/client/marshall.cpp +++ b/dcop/client/marshall.cpp @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define KDE_QT_ONLY #include "../../kdecore/kurl.cpp" -bool mkBool( const QString& s ) +bool mkBool( const TQString& s ) { if ( s.lower() == "true" ) return true; @@ -37,7 +37,7 @@ bool mkBool( const QString& s ) return false; } -QPoint mkPoint( const QString &str ) +TQPoint mkPoint( const TQString &str ) { const char *s = str.latin1(); char *end; @@ -46,10 +46,10 @@ QPoint mkPoint( const QString &str ) s = (const char *)end; while(*s && !isdigit(*s) && *s != '-') s++; int y = strtol(s, &end, 10); - return QPoint( x, y ); + return TQPoint( x, y ); } -QSize mkSize( const QString &str ) +TQSize mkSize( const TQString &str ) { const char *s = str.latin1(); char *end; @@ -58,10 +58,10 @@ QSize mkSize( const QString &str ) s = (const char *)end; while(*s && !isdigit(*s) && *s != '-') s++; int h = strtol(s, &end, 10); - return QSize( w, h ); + return TQSize( w, h ); } -QRect mkRect( const QString &str ) +TQRect mkRect( const TQString &str ) { const char *s = str.latin1(); char *end; @@ -79,28 +79,28 @@ QRect mkRect( const QString &str ) int p4 = strtol(s, &end, 10); if (legacy) { - return QRect( p3, p4, p1, p2 ); + return TQRect( p3, p4, p1, p2 ); } - return QRect( p1, p2, p3, p4 ); + return TQRect( p1, p2, p3, p4 ); } -QColor mkColor( const QString& s ) +TQColor mkColor( const TQString& s ) { - QColor c; + TQColor c; c.setNamedColor(s); return c; } -const char *qStringToC(const QCString &s) +const char *qStringToC(const TQCString &s) { if (s.isEmpty()) return ""; return s.data(); } -QCString demarshal( QDataStream &stream, const QString &type ) +TQCString demarshal( TQDataStream &stream, const TQString &type ) { - QCString result; + TQCString result; if ( type == "int" || type == "Q_INT32" ) { @@ -145,54 +145,54 @@ QCString demarshal( QDataStream &stream, const QString &type ) bool b; stream >> b; result = b ? "true" : "false"; - } else if ( type == "QString" ) + } else if ( type == "TQString" ) { - QString s; + TQString s; stream >> s; result = s.local8Bit(); - } else if ( type == "QCString" ) + } else if ( type == "TQCString" ) { stream >> result; } else if ( type == "QCStringList" ) { - return demarshal( stream, "QValueList<QCString>" ); - } else if ( type == "QStringList" ) + return demarshal( stream, "TQValueList<TQCString>" ); + } else if ( type == "TQStringList" ) { - return demarshal( stream, "QValueList<QString>" ); - } else if ( type == "QColor" ) + return demarshal( stream, "TQValueList<TQString>" ); + } else if ( type == "TQColor" ) { - QColor c; + TQColor c; stream >> c; result = c.name().local8Bit(); - } else if ( type == "QSize" ) + } else if ( type == "TQSize" ) { - QSize s; + TQSize s; stream >> s; result.sprintf( "%dx%d", s.width(), s.height() ); - } else if ( type == "QPixmap" || type == "QImage" ) + } else if ( type == "TQPixmap" || type == "TQImage" ) { - QImage i; + TQImage i; stream >> i; - QByteArray ba; - QBuffer buf( ba ); + TQByteArray ba; + TQBuffer buf( ba ); buf.open( IO_WriteOnly ); i.save( &buf, "XPM" ); result = ba; - } else if ( type == "QPoint" ) + } else if ( type == "TQPoint" ) { - QPoint p; + TQPoint p; stream >> p; result.sprintf( "+%d+%d", p.x(), p.y() ); - } else if ( type == "QRect" ) + } else if ( type == "TQRect" ) { - QRect r; + TQRect r; stream >> r; result.sprintf( "%dx%d+%d+%d", r.width(), r.height(), r.x(), r.y() ); - } else if ( type == "QVariant" ) + } else if ( type == "TQVariant" ) { Q_INT32 type; stream >> type; - return demarshal( stream, QVariant::typeToName( (QVariant::Type)type ) ); + return demarshal( stream, TQVariant::typeToName( (TQVariant::Type)type ) ); } else if ( type == "DCOPRef" ) { DCOPRef r; @@ -203,12 +203,12 @@ QCString demarshal( QDataStream &stream, const QString &type ) KURL r; stream >> r; result = r.url().local8Bit(); - } else if ( type.left( 11 ) == "QValueList<" ) + } else if ( type.left( 11 ) == "TQValueList<" ) { if ( (uint)type.find( '>', 11 ) != type.length() - 1 ) return result; - QString nestedType = type.mid( 11, type.length() - 12 ); + TQString nestedType = type.mid( 11, type.length() - 12 ); if ( nestedType.isEmpty() ) return result; @@ -219,13 +219,13 @@ QCString demarshal( QDataStream &stream, const QString &type ) Q_UINT32 i = 0; for (; i < count; ++i ) { - QCString arg = demarshal( stream, nestedType ); + TQCString arg = demarshal( stream, nestedType ); result += arg; if ( i < count - 1 ) result += '\n'; } - } else if ( type.left( 5 ) == "QMap<" ) + } else if ( type.left( 5 ) == "TQMap<" ) { int commaPos = type.find( ',', 5 ); @@ -235,8 +235,8 @@ QCString demarshal( QDataStream &stream, const QString &type ) if ( (uint)type.find( '>', commaPos ) != type.length() - 1 ) return result; - QString keyType = type.mid( 5, commaPos - 5 ); - QString valueType = type.mid( commaPos + 1, type.length() - commaPos - 2 ); + TQString keyType = type.mid( 5, commaPos - 5 ); + TQString valueType = type.mid( commaPos + 1, type.length() - commaPos - 2 ); Q_UINT32 count; stream >> count; @@ -244,12 +244,12 @@ QCString demarshal( QDataStream &stream, const QString &type ) Q_UINT32 i = 0; for (; i < count; ++i ) { - QCString key = demarshal( stream, keyType ); + TQCString key = demarshal( stream, keyType ); if ( key.isEmpty() ) continue; - QCString value = demarshal( stream, valueType ); + TQCString value = demarshal( stream, valueType ); if ( value.isEmpty() ) continue; @@ -269,19 +269,19 @@ QCString demarshal( QDataStream &stream, const QString &type ) } -void marshall( QDataStream &arg, QCStringList args, uint &i, QString type ) +void marshall( TQDataStream &arg, QCStringList args, uint &i, TQString type ) { if( i >= args.count() ) { qWarning("Not enough arguments (expected %d, got %d).", i, args.count()); exit(1); } - QString s = QString::fromLocal8Bit( args[ i ] ); + TQString s = TQString::fromLocal8Bit( args[ i ] ); - if (type == "QStringList") - type = "QValueList<QString>"; + if (type == "TQStringList") + type = "TQValueList<TQString>"; if (type == "QCStringList") - type = "QValueList<QCString>"; + type = "TQValueList<TQCString>"; if ( type == "int" ) arg << s.toInt(); @@ -294,13 +294,13 @@ void marshall( QDataStream &arg, QCStringList args, uint &i, QString type ) else if ( type == "Q_INT32" ) arg << s.toInt(); else if ( type == "Q_INT64" ) { - QVariant qv = QVariant( s ); + TQVariant qv = TQVariant( s ); arg << qv.toLongLong(); } else if ( type == "Q_UINT32" ) arg << s.toUInt(); else if ( type == "Q_UINT64" ) { - QVariant qv = QVariant( s ); + TQVariant qv = TQVariant( s ); arg << qv.toULongLong(); } else if ( type == "long" ) @@ -317,50 +317,50 @@ void marshall( QDataStream &arg, QCStringList args, uint &i, QString type ) arg << s.toDouble(); else if ( type == "bool" ) arg << mkBool( s ); - else if ( type == "QString" ) + else if ( type == "TQString" ) arg << s; - else if ( type == "QCString" ) - arg << QCString( args[ i ] ); - else if ( type == "QColor" ) + else if ( type == "TQCString" ) + arg << TQCString( args[ i ] ); + else if ( type == "TQColor" ) arg << mkColor( s ); - else if ( type == "QPoint" ) + else if ( type == "TQPoint" ) arg << mkPoint( s ); - else if ( type == "QSize" ) + else if ( type == "TQSize" ) arg << mkSize( s ); - else if ( type == "QRect" ) + else if ( type == "TQRect" ) arg << mkRect( s ); else if ( type == "KURL" ) arg << KURL( s ); - else if ( type == "QVariant" ) { + else if ( type == "TQVariant" ) { if ( s == "true" || s == "false" ) - arg << QVariant( mkBool( s ), 42 ); + arg << TQVariant( mkBool( s ), 42 ); else if ( s.left( 4 ) == "int(" ) - arg << QVariant( s.mid(4, s.length()-5).toInt() ); - else if ( s.left( 7 ) == "QPoint(" ) - arg << QVariant( mkPoint( s.mid(7, s.length()-8) ) ); - else if ( s.left( 6 ) == "QSize(" ) - arg << QVariant( mkSize( s.mid(6, s.length()-7) ) ); - else if ( s.left( 6 ) == "QRect(" ) - arg << QVariant( mkRect( s.mid(6, s.length()-7) ) ); - else if ( s.left( 7 ) == "QColor(" ) - arg << QVariant( mkColor( s.mid(7, s.length()-8) ) ); + arg << TQVariant( s.mid(4, s.length()-5).toInt() ); + else if ( s.left( 7 ) == "TQPoint(" ) + arg << TQVariant( mkPoint( s.mid(7, s.length()-8) ) ); + else if ( s.left( 6 ) == "TQSize(" ) + arg << TQVariant( mkSize( s.mid(6, s.length()-7) ) ); + else if ( s.left( 6 ) == "TQRect(" ) + arg << TQVariant( mkRect( s.mid(6, s.length()-7) ) ); + else if ( s.left( 7 ) == "TQColor(" ) + arg << TQVariant( mkColor( s.mid(7, s.length()-8) ) ); else - arg << QVariant( s ); - } else if ( type.startsWith("QValueList<") || + arg << TQVariant( s ); + } else if ( type.startsWith("TQValueList<") || type == "KURL::List" ) { if ( type == "KURL::List" ) type = "KURL"; else type = type.mid(11, type.length() - 12); - QStringList list; - QString delim = s; + TQStringList list; + TQString delim = s; if (delim == "[") delim = "]"; if (delim == "(") delim = ")"; i++; - QByteArray dummy_data; - QDataStream dummy_arg(dummy_data, IO_WriteOnly); + TQByteArray dummy_data; + TQDataStream dummy_arg(dummy_data, IO_WriteOnly); uint j = i; uint count = 0; @@ -371,7 +371,7 @@ void marshall( QDataStream &arg, QCStringList args, uint &i, QString type ) qWarning("List end-delimiter '%s' not found.", delim.latin1()); exit(1); } - if( QString::fromLocal8Bit( args[ j ] ) == delim ) + if( TQString::fromLocal8Bit( args[ j ] ) == delim ) break; marshall( dummy_arg, args, j, type ); count++; @@ -384,7 +384,7 @@ void marshall( QDataStream &arg, QCStringList args, uint &i, QString type ) qWarning("List end-delimiter '%s' not found.", delim.latin1()); exit(1); } - if( QString::fromLocal8Bit( args[ i ] ) == delim ) + if( TQString::fromLocal8Bit( args[ i ] ) == delim ) break; marshall( arg, args, i, type ); } |