summaryrefslogtreecommitdiffstats
path: root/dcop/client
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 /dcop/client
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 'dcop/client')
-rw-r--r--dcop/client/README.dcop8
-rw-r--r--dcop/client/dcop.cpp44
-rw-r--r--dcop/client/dcopfind.cpp20
-rw-r--r--dcop/client/dcopstart.cpp2
-rw-r--r--dcop/client/marshall.cpp38
5 files changed, 56 insertions, 56 deletions
diff --git a/dcop/client/README.dcop b/dcop/client/README.dcop
index e352cb439..8868b1c55 100644
--- a/dcop/client/README.dcop
+++ b/dcop/client/README.dcop
@@ -21,7 +21,7 @@ exit-code of '0' means success. An exit-code of '1' means error, the error
msg is printed to stderr and no data is printed to stdout.
-dcopfind [-l] [-a] <app-id> [<object-id> [<select_func> [args]]]
+dcoptqfind [-l] [-a] <app-id> [<object-id> [<select_func> [args]]]
Finds an existing DCOP application/object. The select_func can be used to
select a specific single instance out of many based on some criteria.
@@ -38,7 +38,7 @@ With the -a option it prints out "<app-id>" instead of a DCOPRef.
With the -l option it calls "dcopstart <app-id>" if no object is found,
stripping off any wildcard from the <app-id>. If the dcopstart command is
-successful the find command is repeated, if the dcopstart command fails, an
+successful the tqfind command is repeated, if the dcopstart command fails, an
error message is printed to stderr and the command exits with exit-code '2'.
The default selection criteria is "any". Applications can declare their own
@@ -46,7 +46,7 @@ select_func as they see fit, e.g. konqueror could declare
"isDoingProtocol(QString protocol)" and then the following command would
select a konqueror mainwindow that is currently handling the help-protocol:
- "dcopfind 'konqueror*' 'konqueror-mainwindow*' 'isDoingProtocol(QString
+ "dcoptqfind 'konqueror*' 'konqueror-mainwindow*' 'isDoingProtocol(QString
protocol)' help"
@@ -57,7 +57,7 @@ In addtion to the current syntax of
dcop <appid> <object> <function> args
you will now also be able to use <dcopref> to make calls with <dcopref> being
-"DCOPRef(<appid>, <objectid>)" as returned by dcopfind.
+"DCOPRef(<appid>, <objectid>)" as returned by dcoptqfind.
Additional utilities:
diff --git a/dcop/client/dcop.cpp b/dcop/client/dcop.cpp
index 1d167ce70..86b63cba6 100644
--- a/dcop/client/dcop.cpp
+++ b/dcop/client/dcop.cpp
@@ -158,9 +158,9 @@ void queryFunctions( const char* app, const char* obj )
int callFunction( const char* app, const char* obj, const char* func, const QCStringList args )
{
- TQString f = func; // Qt is better with unicode strings, so use one.
- int left = f.find( '(' );
- int right = f.find( ')' );
+ TQString f = func; // Qt is better with tqunicode strings, so use one.
+ int left = f.tqfind( '(' );
+ int right = f.tqfind( ')' );
if ( right < left )
{
@@ -181,12 +181,12 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt
return( 1 );
}
for ( QCStringList::Iterator it = funcs.begin(); it != funcs.end(); ++it ) {
- int l = (*it).find( '(' );
+ int l = (*it).tqfind( '(' );
int s;
if (l > 0)
- s = (*it).findRev( ' ', l);
+ s = (*it).tqfindRev( ' ', l);
else
- s = (*it).find( ' ' );
+ s = (*it).tqfind( ' ' );
if ( s < 0 )
s = 0;
@@ -195,8 +195,8 @@ 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 TQString arguments = (*it).mid(l+1,(*it).find( ')' )-l-1);
- uint a = arguments.contains(',');
+ const TQString arguments = (*it).mid(l+1,(*it).tqfind( ')' )-l-1);
+ uint a = arguments.tqcontains(',');
if ( (a==0 && !arguments.isEmpty()) || a>0)
a++;
if ( a == args.count() )
@@ -209,8 +209,8 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt
return( 1 );
}
f = realfunc;
- left = f.find( '(' );
- right = f.find( ')' );
+ left = f.tqfind( '(' );
+ right = f.tqfind( ')' );
}
doit:
@@ -230,7 +230,7 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt
for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) {
TQString lt = (*it).simplifyWhiteSpace();
- int s = lt.find(' ');
+ int s = lt.tqfind(' ');
// If there are spaces in the name, there may be two
// reasons: the parameter name is still there, ie.
@@ -250,7 +250,7 @@ int callFunction( const char* app, const char* obj, const char* func, const QCSt
//
s=1;
- while (s < static_cast<int>(partl.count()) && intTypes.contains(partl[s]))
+ while (s < static_cast<int>(partl.count()) && intTypes.tqcontains(partl[s]))
{
s++;
}
@@ -345,7 +345,7 @@ void showHelp( int exitCode = 0 )
<< " in bash, but because no new dcop instance has to be started" << endl
<< " for each line this is generally much faster, especially for" << endl
<< " the slower GNU dynamic linkers." << endl
- << " The '%1' placeholder cannot be used to replace e.g. the" << endl
+ << " The '%1' placeholder cannot be used to tqreplace e.g. the" << endl
<< " program, object or method name." << endl
<< " --user <user> Connect to the given user's DCOP server. This option will" << endl
<< " ignore the values of the environment vars $DCOPSERVER and" << endl
@@ -464,9 +464,9 @@ int runDCOP( QCStringList args, UserList users, Session session,
QCStringList params;
DCOPClient *client = 0L;
int retval = 0;
- if ( !args.isEmpty() && args[ 0 ].find( "DCOPRef(" ) == 0 )
+ if ( !args.isEmpty() && args[ 0 ].tqfind( "DCOPRef(" ) == 0 )
{
- int delimPos = args[ 0 ].findRev( ',' );
+ int delimPos = args[ 0 ].tqfindRev( ',' );
if( delimPos == -1 )
{
cerr_ << "Error: '" << args[ 0 ]
@@ -569,7 +569,7 @@ int runDCOP( QCStringList args, UserList users, Session session,
}
else if( !sessionName.isEmpty() )
{
- if( sessions.contains( sessionName ) )
+ if( sessions.tqcontains( sessionName ) )
{
sessions.clear();
sessions.append( sessionName );
@@ -625,7 +625,7 @@ int runDCOP( QCStringList args, UserList users, Session session,
continue;
else
{
- cerr_ << "WARNING: Cannot find ICE authority file "
+ cerr_ << "WARNING: Cannot tqfind ICE authority file "
<< iceFile << "!" << endl
<< "Please check permissions or set the $ICEAUTHORITY"
<< " variable manually before" << endl
@@ -706,12 +706,12 @@ int runDCOP( QCStringList args, UserList users, Session session,
sendUserTime( app );
if( readStdin )
{
- QCStringList::Iterator replaceArg = params.end();
+ QCStringList::Iterator tqreplaceArg = params.end();
QCStringList::Iterator it = params.begin();
for( ; it != params.end(); ++it )
if( *it == "%1" )
- replaceArg = it;
+ tqreplaceArg = it;
// Read from stdin until EOF and call function for each
// read line
@@ -719,8 +719,8 @@ int runDCOP( QCStringList args, UserList users, Session session,
{
TQString buf = cin_.readLine();
- if( replaceArg != params.end() )
- *replaceArg = buf.local8Bit();
+ if( tqreplaceArg != params.end() )
+ *tqreplaceArg = buf.local8Bit();
if( !buf.isNull() )
{
@@ -861,7 +861,7 @@ int main( int argc, char** argv )
if (prog[prog.length()-1] != '*')
{
// Strip a trailing -<PID> part.
- int i = prog.findRev('-');
+ int i = prog.tqfindRev('-');
if ((i >= 0) && prog.mid(i+1).toLong())
{
prog = prog.left(i);
diff --git a/dcop/client/dcopfind.cpp b/dcop/client/dcopfind.cpp
index cd3e4d517..c8feb5936 100644
--- a/dcop/client/dcopfind.cpp
+++ b/dcop/client/dcopfind.cpp
@@ -38,11 +38,11 @@ static DCOPClient* dcop = 0;
static bool bAppIdOnly = 0;
static bool bLaunchApp = 0;
-bool findObject( const char* app, const char* obj, const char* func, QCStringList args )
+bool tqfindObject( const char* app, const char* obj, const char* func, QCStringList args )
{
- TQString f = func; // Qt is better with unicode strings, so use one.
- int left = f.find( '(' );
- int right = f.find( ')' );
+ TQString f = func; // Qt is better with tqunicode strings, so use one.
+ int left = f.tqfind( '(' );
+ int right = f.tqfind( ')' );
if ( right < left )
{
@@ -66,7 +66,7 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis
for ( TQStringList::Iterator it = types.begin(); it != types.end(); ++it ) {
TQString lt = (*it).simplifyWhiteSpace();
- int s = lt.find(' ');
+ int s = lt.tqfind(' ');
// If there are spaces in the name, there may be two
// reasons: the parameter name is still there, ie.
@@ -86,7 +86,7 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis
//
s=1;
- while (s < (int)partl.count() && intTypes.contains(partl[s]))
+ while (s < (int)partl.count() && intTypes.tqcontains(partl[s]))
{
s++;
}
@@ -139,7 +139,7 @@ bool findObject( const char* app, const char* obj, const char* func, QCStringLis
TQCString foundApp;
TQCString foundObj;
- if ( dcop->findObject( app, obj, f.latin1(), data, foundApp, foundObj) )
+ if ( dcop->tqfindObject( app, obj, f.latin1(), data, foundApp, foundObj) )
{
if (bAppIdOnly)
puts(foundApp.data());
@@ -192,7 +192,7 @@ bool launchApp(TQString app)
void usage()
{
- fprintf( stderr, "Usage: dcopfind [-l] [-a] application [object [function [arg1] [arg2] [arg3] ... ] ] ] \n" );
+ fprintf( stderr, "Usage: dcoptqfind [-l] [-a] application [object [function [arg1] [arg2] [arg3] ... ] ] ] \n" );
exit(0);
}
@@ -267,7 +267,7 @@ int main( int argc, char** argv )
QCStringList params;
for( int i = 0; i < argc; i++ )
params.append( args[ i ] );
- bool ok = findObject( app, objid, function, params );
+ bool ok = tqfindObject( app, objid, function, params );
if (ok)
return 0;
if (bLaunchApp)
@@ -275,7 +275,7 @@ int main( int argc, char** argv )
ok = launchApp(app);
if (!ok)
return 2;
- ok = findObject( app, objid, function, params );
+ ok = tqfindObject( app, objid, function, params );
}
return 1;
diff --git a/dcop/client/dcopstart.cpp b/dcop/client/dcopstart.cpp
index 5741ef775..f46531735 100644
--- a/dcop/client/dcopstart.cpp
+++ b/dcop/client/dcopstart.cpp
@@ -33,7 +33,7 @@ static DCOPClient* dcop = 0;
void startApp(const char *_app, int argc, const char **args)
{
const char *function = 0;
- TQString app = TQString::fromLatin1(_app);
+ TQString app = TQString::tqfromLatin1(_app);
if (app.endsWith(".desktop"))
function = "start_service_by_desktop_path(TQString,TQStringList)";
else
diff --git a/dcop/client/marshall.cpp b/dcop/client/marshall.cpp
index f9b7955f2..1e3c8d887 100644
--- a/dcop/client/marshall.cpp
+++ b/dcop/client/marshall.cpp
@@ -102,12 +102,12 @@ TQCString demarshal( TQDataStream &stream, const TQString &type )
{
TQCString result;
- if ( type == "int" || type == "Q_INT32" )
+ if ( type == "int" || type == "TQ_INT32" )
{
int i;
stream >> i;
result.setNum( i );
- } else if ( type == "uint" || type == "Q_UINT32" || type == "unsigned int" )
+ } else if ( type == "uint" || type == "TQ_UINT32" || type == "unsigned int" )
{
uint i;
stream >> i;
@@ -132,12 +132,12 @@ TQCString demarshal( TQDataStream &stream, const TQString &type )
double d;
stream >> d;
result.setNum( d, 'f' );
- } else if ( type == "Q_INT64" ) {
- Q_INT64 i;
+ } else if ( type == "TQ_INT64" ) {
+ TQ_INT64 i;
stream >> i;
result.sprintf( "%lld", i );
- } else if ( type == "Q_UINT64" ) {
- Q_UINT64 i;
+ } else if ( type == "TQ_UINT64" ) {
+ TQ_UINT64 i;
stream >> i;
result.sprintf( "%llu", i );
} else if ( type == "bool" )
@@ -190,7 +190,7 @@ TQCString demarshal( TQDataStream &stream, const TQString &type )
result.sprintf( "%dx%d+%d+%d", r.width(), r.height(), r.x(), r.y() );
} else if ( type == "TQVariant" )
{
- Q_INT32 type;
+ TQ_INT32 type;
stream >> type;
return demarshal( stream, TQVariant::typeToName( (TQVariant::Type)type ) );
} else if ( type == "DCOPRef" )
@@ -205,7 +205,7 @@ TQCString demarshal( TQDataStream &stream, const TQString &type )
result = r.url().local8Bit();
} else if ( type.left( 11 ) == "TQValueList<" )
{
- if ( (uint)type.find( '>', 11 ) != type.length() - 1 )
+ if ( (uint)type.tqfind( '>', 11 ) != type.length() - 1 )
return result;
TQString nestedType = type.mid( 11, type.length() - 12 );
@@ -213,10 +213,10 @@ TQCString demarshal( TQDataStream &stream, const TQString &type )
if ( nestedType.isEmpty() )
return result;
- Q_UINT32 count;
+ TQ_UINT32 count;
stream >> count;
- Q_UINT32 i = 0;
+ TQ_UINT32 i = 0;
for (; i < count; ++i )
{
TQCString arg = demarshal( stream, nestedType );
@@ -227,21 +227,21 @@ TQCString demarshal( TQDataStream &stream, const TQString &type )
}
} else if ( type.left( 5 ) == "TQMap<" )
{
- int commaPos = type.find( ',', 5 );
+ int commaPos = type.tqfind( ',', 5 );
if ( commaPos == -1 )
return result;
- if ( (uint)type.find( '>', commaPos ) != type.length() - 1 )
+ if ( (uint)type.tqfind( '>', commaPos ) != type.length() - 1 )
return result;
TQString keyType = type.mid( 5, commaPos - 5 );
TQString valueType = type.mid( commaPos + 1, type.length() - commaPos - 2 );
- Q_UINT32 count;
+ TQ_UINT32 count;
stream >> count;
- Q_UINT32 i = 0;
+ TQ_UINT32 i = 0;
for (; i < count; ++i )
{
TQCString key = demarshal( stream, keyType );
@@ -291,15 +291,15 @@ void marshall( TQDataStream &arg, QCStringList args, uint &i, TQString type )
arg << s.toUInt();
else if ( type == "unsigned int" )
arg << s.toUInt();
- else if ( type == "Q_INT32" )
+ else if ( type == "TQ_INT32" )
arg << s.toInt();
- else if ( type == "Q_INT64" ) {
+ else if ( type == "TQ_INT64" ) {
TQVariant qv = TQVariant( s );
arg << qv.toLongLong();
}
- else if ( type == "Q_UINT32" )
+ else if ( type == "TQ_UINT32" )
arg << s.toUInt();
- else if ( type == "Q_UINT64" ) {
+ else if ( type == "TQ_UINT64" ) {
TQVariant qv = TQVariant( s );
arg << qv.toULongLong();
}
@@ -376,7 +376,7 @@ void marshall( TQDataStream &arg, QCStringList args, uint &i, TQString type )
marshall( dummy_arg, args, j, type );
count++;
}
- arg << (Q_UINT32) count;
+ arg << (TQ_UINT32) count;
// Parse the list for real
while (true) {
if( i > args.count() )