@ -49,7 +49,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
#include "marshall.cpp"
#include "marshall.cpp"
+ typedef QMap< QString, QString> UserList;
+ typedef QMap< T QString, T QString> UserList;
+
+
static DCOPClient* dcop = 0;
static DCOPClient* dcop = 0;
@ -78,7 +78,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
! void callFunction( const char* app, const char* obj, const char* func, int argc, char** args )
! void callFunction( const char* app, const char* obj, const char* func, int argc, char** args )
{
{
-
-
QString f = func; // Qt is better with unicode strings, so use one.
T QString f = func; // Qt is better with unicode strings, so use one.
int left = f.find( '(' );
int left = f.find( '(' );
int right = f.find( ')' );
int right = f.find( ')' );
--- 146,153 ----
--- 146,153 ----
@ -87,7 +87,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
! void callFunction( const char* app, const char* obj, const char* func, const QCStringList args )
! void 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.
T QString f = func; // Qt is better with unicode strings, so use one.
int left = f.find( '(' );
int left = f.find( '(' );
int right = f.find( ')' );
int right = f.find( ')' );
***************
***************
@ -310,7 +310,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
! * Return a list of available DCOP sessions for the specified user
! * Return a list of available DCOP sessions for the specified user
! * An empty list means no sessions are available, or an error occurred.
! * An empty list means no sessions are available, or an error occurred.
! */
! */
! QStringList dcopSessionList( const QString &user, const QString &home )
! QStringList dcopSessionList( const T QString &user, const T QString &home )
! {
! {
! if( home.isEmpty() )
! if( home.isEmpty() )
! {
! {
@ -350,7 +350,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
+ * Do the actual DCOP call
+ * Do the actual DCOP call
+ */
+ */
+ void runDCOP( QCStringList args, UserList users, Session session,
+ void runDCOP( QCStringList args, UserList users, Session session,
+ const QString sessionName, bool readStdin )
+ const T QString sessionName, bool readStdin )
+ {
+ {
QCString app;
QCString app;
QCString objid;
QCString objid;
@ -406,7 +406,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
! QStringList sessions;
! QStringList sessions;
! bool presetDCOPServer = false;
! bool presetDCOPServer = false;
! // char *dcopStr = 0L;
! // char *dcopStr = 0L;
! QString dcopServer;
! T QString dcopServer;
!
!
! for( it = users.begin(); it != users.end() || firstRun; it++ )
! for( it = users.begin(); it != users.end() || firstRun; it++ )
! {
! {
@ -475,8 +475,8 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
+ ( getenv( "ICEAUTHORITY" ) == 0 || getenv( "DISPLAY" ) == 0 ) ) )
+ ( getenv( "ICEAUTHORITY" ) == 0 || getenv( "DISPLAY" ) == 0 ) ) )
+ {
+ {
+ // Check for ICE authority file and if the file can be read by us
+ // Check for ICE authority file and if the file can be read by us
+ QString home = it.data();
+ T QString home = it.data();
+ QString iceFile = it.data() + "/.ICEauthority";
+ T QString iceFile = it.data() + "/.ICEauthority";
+ QFileInfo fi( iceFile );
+ QFileInfo fi( iceFile );
+ if( iceFile.isEmpty() )
+ if( iceFile.isEmpty() )
+ {
+ {
@ -525,7 +525,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
+ {
+ {
+ if( !presetDCOPServer && !users.isEmpty() )
+ if( !presetDCOPServer && !users.isEmpty() )
+ {
+ {
+ QString dcopFile = it.data() + "/" + *sIt;
+ T QString dcopFile = it.data() + "/" + *sIt;
+ QFile f( dcopFile );
+ QFile f( dcopFile );
+ if( !f.open( IO_ReadOnly ) )
+ if( !f.open( IO_ReadOnly ) )
+ {
+ {
@ -622,9 +622,9 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
+ {
+ {
+ bool readStdin = false;
+ bool readStdin = false;
+ int numOptions = 0;
+ int numOptions = 0;
+ QString user;
+ T QString user;
+ Session session = DefaultSession;
+ Session session = DefaultSession;
+ QString sessionName;
+ T QString sessionName;
+
+
+ // Scan for command-line options first
+ // Scan for command-line options first
+ for( int pos = 1 ; pos <= argc - 1 ; pos++ )
+ for( int pos = 1 ; pos <= argc - 1 ; pos++ )
@ -640,7 +640,7 @@ diff -cr dcop/client/dcop.cpp dcop2/client/dcop.cpp
+ {
+ {
+ if( pos <= argc - 2 )
+ if( pos <= argc - 2 )
+ {
+ {
+ user = QString::fromLocal8Bit( argv[ pos + 1] );
+ user = T QString::fromLocal8Bit( argv[ pos + 1] );
+ numOptions +=2;
+ numOptions +=2;
+ pos++;
+ pos++;
+ }
+ }
@ -734,7 +734,7 @@ diff -cr dcop/client/dcopfind.cpp dcop2/client/dcopfind.cpp
! bool findObject( const char* app, const char* obj, const char* func, int argc, char** args )
! bool findObject( const char* app, const char* obj, const char* func, int argc, char** args )
{
{
QString f = func; // Qt is better with unicode strings, so use one.
T QString f = func; // Qt is better with unicode strings, so use one.
int left = f.find( '(' );
int left = f.find( '(' );
--- 36,42 ----
--- 36,42 ----
static bool bAppIdOnly = 0;
static bool bAppIdOnly = 0;
@ -742,7 +742,7 @@ diff -cr dcop/client/dcopfind.cpp dcop2/client/dcopfind.cpp
! bool findObject( const char* app, const char* obj, const char* func, QCStringList args )
! 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.
T QString f = func; // Qt is better with unicode strings, so use one.
int left = f.find( '(' );
int left = f.find( '(' );
***************
***************
*** 118,124 ****
*** 118,124 ****
@ -811,10 +811,10 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
}
}
! void marshall(QDataStream &arg, int argc, char **argv, int &i, QString type)
! void marshall(QDataStream &arg, int argc, char **argv, int &i, T QString type)
{
{
! if (type == "TQStringList")
! if (type == "TQStringList")
! type = "QValueList< QString>";
! type = "QValueList< T QString>";
! if (type == "QCStringList")
! if (type == "QCStringList")
! type = "QValueList<QCString>";
! type = "QValueList<QCString>";
! if (i >= argc)
! if (i >= argc)
@ -822,7 +822,7 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
! tqWarning("Not enough arguments.");
! tqWarning("Not enough arguments.");
! exit(1);
! exit(1);
! }
! }
! QString s = QString::fromLocal8Bit(argv[i]);
! T QString s = T QString::fromLocal8Bit(argv[i]);
!
!
! if ( type == "int" )
! if ( type == "int" )
! arg << s.toInt();
! arg << s.toInt();
@ -850,7 +850,7 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
! arg << s;
! arg << s;
! else if ( type == "QCString" )
! else if ( type == "QCString" )
! arg << QCString( argv[i] );
! arg << QCString( argv[i] );
! else if ( type == " QColor" )
! else if ( type == " T QColor" )
! arg << mkColor( s );
! arg << mkColor( s );
! else if ( type == "TQPoint" )
! else if ( type == "TQPoint" )
! arg << mkPoint( s );
! arg << mkPoint( s );
@ -869,14 +869,14 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
! arg << QVariant( mkSize( s.mid(6, s.length()-7) ) );
! arg << QVariant( mkSize( s.mid(6, s.length()-7) ) );
! else if ( s.left( 6 ) == "QRect(" )
! else if ( s.left( 6 ) == "QRect(" )
! arg << QVariant( mkRect( s.mid(6, s.length()-7) ) );
! arg << QVariant( mkRect( s.mid(6, s.length()-7) ) );
! else if ( s.left( 7 ) == " QColor(" )
! else if ( s.left( 7 ) == " T QColor(" )
! arg << QVariant( mkColor( s.mid(7, s.length()-8) ) );
! arg << QVariant( mkColor( s.mid(7, s.length()-8) ) );
! else
! else
! arg << QVariant( s );
! arg << QVariant( s );
! } else if ( type.startsWith("QValueList<")) {
! } else if ( type.startsWith("QValueList<")) {
! type = type.mid(11, type.length() - 12);
! type = type.mid(11, type.length() - 12);
! QStringList list;
! QStringList list;
! QString delim = s;
! T QString delim = s;
! if (delim == "[")
! if (delim == "[")
! delim = "]";
! delim = "]";
! if (delim == "(")
! if (delim == "(")
@ -920,10 +920,10 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
}
}
! void marshall( QDataStream &arg, QCStringList args, uint &i, QString type )
! void marshall( QDataStream &arg, QCStringList args, uint &i, T QString type )
{
{
! if (type == "TQStringList")
! if (type == "TQStringList")
! type = "QValueList< QString>";
! type = "QValueList< T QString>";
! if (type == "QCStringList")
! if (type == "QCStringList")
! type = "QValueList<QCString>";
! type = "QValueList<QCString>";
! if( i > args.count() )
! if( i > args.count() )
@ -931,7 +931,7 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
! tqWarning("Not enough arguments.");
! tqWarning("Not enough arguments.");
! exit(1);
! exit(1);
! }
! }
! QString s = QString::fromLocal8Bit( args[ i ] );
! T QString s = T QString::fromLocal8Bit( args[ i ] );
! if ( type == "int" )
! if ( type == "int" )
! arg << s.toInt();
! arg << s.toInt();
@ -959,7 +959,7 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
! arg << s;
! arg << s;
! else if ( type == "QCString" )
! else if ( type == "QCString" )
! arg << QCString( args[ i ] );
! arg << QCString( args[ i ] );
! else if ( type == " QColor" )
! else if ( type == " T QColor" )
! arg << mkColor( s );
! arg << mkColor( s );
! else if ( type == "TQPoint" )
! else if ( type == "TQPoint" )
! arg << mkPoint( s );
! arg << mkPoint( s );
@ -978,14 +978,14 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
! arg << QVariant( mkSize( s.mid(6, s.length()-7) ) );
! arg << QVariant( mkSize( s.mid(6, s.length()-7) ) );
! else if ( s.left( 6 ) == "QRect(" )
! else if ( s.left( 6 ) == "QRect(" )
! arg << QVariant( mkRect( s.mid(6, s.length()-7) ) );
! arg << QVariant( mkRect( s.mid(6, s.length()-7) ) );
! else if ( s.left( 7 ) == " QColor(" )
! else if ( s.left( 7 ) == " T QColor(" )
! arg << QVariant( mkColor( s.mid(7, s.length()-8) ) );
! arg << QVariant( mkColor( s.mid(7, s.length()-8) ) );
! else
! else
! arg << QVariant( s );
! arg << QVariant( s );
! } else if ( type.startsWith("QValueList<")) {
! } else if ( type.startsWith("QValueList<")) {
! type = type.mid(11, type.length() - 12);
! type = type.mid(11, type.length() - 12);
! QStringList list;
! QStringList list;
! QString delim = s;
! T QString delim = s;
! if (delim == "[")
! if (delim == "[")
! delim = "]";
! delim = "]";
! if (delim == "(")
! if (delim == "(")
@ -1003,7 +1003,7 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
+ tqWarning("List end-delimiter '%s' not found.", delim.latin1());
+ tqWarning("List end-delimiter '%s' not found.", delim.latin1());
+ exit(1);
+ exit(1);
+ }
+ }
+ if( QString::fromLocal8Bit( args[ j ] ) == delim )
+ if( T QString::fromLocal8Bit( args[ j ] ) == delim )
+ break;
+ break;
+ marshall( dummy_arg, args, j, type );
+ marshall( dummy_arg, args, j, type );
+ count++;
+ count++;
@ -1016,7 +1016,7 @@ diff -cr dcop/client/marshall.cpp dcop2/client/marshall.cpp
+ tqWarning("List end-delimiter '%s' not found.", delim.latin1());
+ tqWarning("List end-delimiter '%s' not found.", delim.latin1());
+ exit(1);
+ exit(1);
+ }
+ }
+ if( QString::fromLocal8Bit( args[ i ] ) == delim )
+ if( T QString::fromLocal8Bit( args[ i ] ) == delim )
+ break;
+ break;
+ marshall( arg, args, i, type );
+ marshall( arg, args, i, type );
+ }
+ }