summaryrefslogtreecommitdiffstats
path: root/dcop/dcopserver.cpp
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/dcopserver.cpp
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/dcopserver.cpp')
-rw-r--r--dcop/dcopserver.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/dcop/dcopserver.cpp b/dcop/dcopserver.cpp
index 41a639b2e..11ef834e3 100644
--- a/dcop/dcopserver.cpp
+++ b/dcop/dcopserver.cpp
@@ -82,7 +82,7 @@ template class TQPtrList<DCOPListener>;
#define _DCOPIceSendEnd() \
fcntl(fd, F_SETFL, fd_fl);
-static TQCString findDcopserverShutdown()
+static TQCString tqfindDcopserverShutdown()
{
#ifdef Q_OS_WIN32
char szPath[512];
@@ -124,9 +124,9 @@ void DCOPIceWriteChar(register IceConn iceConn, unsigned long nbytes, char *ptr)
static TQCString readQCString(TQDataStream &ds)
{
TQCString result;
- Q_UINT32 len;
+ TQ_UINT32 len;
ds >> len;
- TQIODevice *device = ds.device();
+ TQIODevice *device = ds.tqdevice();
int bytesLeft = device->size()-device->at();
if ((bytesLeft < 0 ) || (len > (uint) bytesLeft))
{
@@ -142,9 +142,9 @@ static TQCString readQCString(TQDataStream &ds)
static TQByteArray readQByteArray(TQDataStream &ds)
{
TQByteArray result;
- Q_UINT32 len;
+ TQ_UINT32 len;
ds >> len;
- TQIODevice *device = ds.device();
+ TQIODevice *device = ds.tqdevice();
int bytesLeft = device->size()-device->at();
if ((bytesLeft < 0 ) || (len > (uint) bytesLeft))
{
@@ -238,7 +238,7 @@ static unsigned long writeIceData(IceConn iceConn, unsigned long nbytes, char *p
void DCOPIceWriteChar(register IceConn iceConn, unsigned long nbytes, char *ptr)
{
- DCOPConnection* conn = the_server->findConn( iceConn );
+ DCOPConnection* conn = the_server->tqfindConn( iceConn );
#ifdef DCOP_DEBUG
qWarning("DCOPServer: DCOPIceWriteChar() Writing %d bytes to %d [%s]", nbytes, fd, conn ? conn->appId.data() : "<unknown>");
#endif
@@ -270,7 +270,7 @@ qWarning("DCOPServer: _IceWrite() outputBlocked. Queuing %d bytes.", _data.size(
static void DCOPIceWrite(IceConn iceConn, const TQByteArray &_data)
{
- DCOPConnection* conn = the_server->findConn( iceConn );
+ DCOPConnection* conn = the_server->tqfindConn( iceConn );
#ifdef DCOP_DEBUG
qWarning("DCOPServer: DCOPIceWrite() Writing %d bytes to %d [%s]", _data.size(), fd, conn ? conn->appId.data() : "<unknown>");
#endif
@@ -287,7 +287,7 @@ qWarning("DCOPServer: DCOPIceWrite() outputBlocked. Queuing %d bytes.", _data.si
// assert(conn->outputBuffer.isEmpty());
}
- unsigned long nleft = writeIceData(iceConn, _data.size(), _data.data());
+ unsigned long nleft = writeIceData(iceConn, _data.size(), const_cast<TQByteArray&>(_data).data());
if ((nleft > 0) && conn)
{
conn->waitForOutputReady(_data, _data.size() - nleft);
@@ -319,7 +319,7 @@ void DCOPServer::slotOutputReady(int socket)
qWarning("DCOPServer: slotOutputReady fd = %d", socket);
#endif
// Find out connection.
- DCOPConnection *conn = fd_clients.find(socket);
+ DCOPConnection *conn = fd_clients.tqfind(socket);
//assert(conn);
//assert(conn->outputBlocked);
//assert(conn->socket() == socket);
@@ -396,7 +396,7 @@ qWarning("DCOPServer: Flushing data, fd = %d", IceConnectionNumber(_iceConn));
DCOPIceWrite(_iceConn, _data);
}
-class DCOPListener : public QSocketNotifier
+class DCOPListener : public TQSocketNotifier
{
public:
DCOPListener( IceListenObj obj )
@@ -487,7 +487,7 @@ write_iceauth (FILE *addfp, IceAuthDataEntry *entry)
SUFFIX_LEN tells us how long <suffix> is (it can be zero length).
The last six characters of TEMPLATE before <suffix> must be "XXXXXX";
- they are replaced with a string that makes the filename unique.
+ they are tqreplaced with a string that makes the filename unique.
Returns a file descriptor open on the file for reading and writing. */
@@ -535,7 +535,7 @@ int mkstemps (char* _template, int suffix_len)
with (module 2^32). */
value += 7777;
}
- /* We return the null string if we can't find a unique file name. */
+ /* We return the null string if we can't tqfind a unique file name. */
_template[0] = '\0';
return -1;
}
@@ -710,7 +710,7 @@ void DCOPProcessMessage( IceConn iceConn, IcePointer /*clientData*/,
void DCOPServer::processMessage( IceConn iceConn, int opcode,
unsigned long length, Bool /*swap*/)
{
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if ( !conn ) {
qWarning("DCOPServer::processMessage message from unknown connection. [opcode = %d]", opcode);
return;
@@ -728,7 +728,7 @@ void DCOPServer::processMessage( IceConn iceConn, int opcode,
TQCString fromApp = readQCString(ds);
TQCString toApp = readQCString(ds);
- DCOPConnection* target = findApp( toApp );
+ DCOPConnection* target = tqfindApp( toApp );
int datalen = ba.size();
if ( opcode == DCOPReplyDelayed ) {
if ( !target )
@@ -805,7 +805,7 @@ if (opcode == DCOPSend)
TQDataStream ds( ba, IO_ReadOnly );
TQCString fromApp = readQCString(ds);
TQCString toApp = readQCString(ds);
- DCOPConnection* target = findApp( toApp );
+ DCOPConnection* target = tqfindApp( toApp );
int datalen = ba.size();
if ( target ) {
@@ -888,7 +888,7 @@ if (opcode == DCOPCall)
TQCString fromApp = readQCString(ds);
TQCString toApp = readQCString(ds);
- DCOPConnection* connreply = findApp( toApp );
+ DCOPConnection* connreply = tqfindApp( toApp );
int datalen = ba.size();
if ( !connreply )
@@ -1090,7 +1090,7 @@ DCOPServer::DCOPServer(bool _suicide)
DCOPServer::~DCOPServer()
{
- system(findDcopserverShutdown()+" --nokill");
+ system(tqfindDcopserverShutdown()+" --nokill");
IceFreeListenObjs(numTransports, listenObjs);
FreeAuthenticationData(numTransports, authDataEntries);
delete dcopSignals;
@@ -1105,11 +1105,11 @@ DCOPServer::~DCOPServer()
#endif
}
-DCOPConnection* DCOPServer::findApp( const TQCString& appId )
+DCOPConnection* DCOPServer::tqfindApp( const TQCString& appId )
{
if ( appId.isNull() )
return 0;
- DCOPConnection* conn = appIds.find( appId );
+ DCOPConnection* conn = appIds.tqfind( appId );
return conn;
}
@@ -1204,7 +1204,7 @@ void DCOPServer::removeConnection( void* data )
while (!conn->waitingForReply.isEmpty()) {
IceConn iceConn = conn->waitingForReply.take(0);
if (iceConn) {
- DCOPConnection* target = clients.find( iceConn );
+ DCOPConnection* target = clients.tqfind( iceConn );
qWarning("DCOP aborting call from '%s' to '%s'", target ? target->appId.data() : "<unknown>" , conn->appId.data() );
TQByteArray reply;
DCOPMsg *pMsg;
@@ -1226,7 +1226,7 @@ void DCOPServer::removeConnection( void* data )
while (!conn->waitingForDelayedReply.isEmpty()) {
IceConn iceConn = conn->waitingForDelayedReply.take(0);
if (iceConn) {
- DCOPConnection* target = clients.find( iceConn );
+ DCOPConnection* target = clients.tqfind( iceConn );
qWarning("DCOP aborting (delayed) call from '%s' to '%s'", target ? target->appId.data() : "<unknown>", conn->appId.data() );
TQByteArray reply;
DCOPMsg *pMsg;
@@ -1247,7 +1247,7 @@ void DCOPServer::removeConnection( void* data )
{
IceConn iceConn = conn->waitingOnReply.take(0);
if (iceConn) {
- DCOPConnection* target = clients.find( iceConn );
+ DCOPConnection* target = clients.tqfind( iceConn );
if (!target)
{
qWarning("DCOP Error: still waiting for answer from non-existing client.");
@@ -1295,7 +1295,7 @@ void DCOPServer::slotTerminate()
dcopSignals->emitSignal(0L /* dcopserver */, "terminateKDE()", data, false);
disconnect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTerminate()) );
connect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotSuicide()) );
- system(findDcopserverShutdown()+" --nokill");
+ system(tqfindDcopserverShutdown()+" --nokill");
}
void DCOPServer::slotSuicide()
@@ -1359,7 +1359,7 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
if ( obj == "emit")
{
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if (conn) {
//qDebug("DCOPServer: %s emits %s", conn->appId.data(), fun.data());
dcopSignals->emitSignal(conn, fun, data, false);
@@ -1370,13 +1370,13 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
if ( fun == "setDaemonMode(bool)" ) {
TQDataStream args( data, IO_ReadOnly );
if ( !args.atEnd() ) {
- Q_INT8 iDaemon;
+ TQ_INT8 iDaemon;
bool daemon;
args >> iDaemon;
daemon = static_cast<bool>( iDaemon );
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if ( conn && !conn->appId.isNull() ) {
if ( daemon ) {
if ( !conn->daemon )
@@ -1414,10 +1414,10 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
if (!args.atEnd()) {
TQCString app2 = readQCString(args);
TQDataStream reply( replyData, IO_WriteOnly );
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if ( conn && !app2.isEmpty() ) {
if ( !conn->appId.isNull() &&
- appIds.find( conn->appId ) == conn ) {
+ appIds.tqfind( conn->appId ) == conn ) {
appIds.remove( conn->appId );
}
@@ -1440,7 +1440,7 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
#endif
conn->appId = app2;
- if ( appIds.find( app2 ) != 0 ) {
+ if ( appIds.tqfind( app2 ) != 0 ) {
// we already have this application, unify
int n = 1;
TQCString tmp;
@@ -1449,12 +1449,12 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
tmp.setNum( n );
tmp.prepend("-");
tmp.prepend( app2 );
- } while ( appIds.find( tmp ) != 0 );
+ } while ( appIds.tqfind( tmp ) != 0 );
conn->appId = tmp;
}
appIds.insert( conn->appId, conn );
- int c = conn->appId.find( '-' );
+ int c = conn->appId.tqfind( '-' );
if ( c > 0 )
conn->plainAppId = conn->appId.left( c );
else
@@ -1486,7 +1486,7 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
if (!args.atEnd()) {
TQCString s = readQCString(args);
TQDataStream reply( replyData, IO_WriteOnly );
- int b = ( findApp( s ) != 0 );
+ int b = ( tqfindApp( s ) != 0 );
replyType = "bool";
reply << b;
return true;
@@ -1494,9 +1494,9 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
} else if ( fun == "setNotifications(bool)" ) {
TQDataStream args( data, IO_ReadOnly );
if (!args.atEnd()) {
- Q_INT8 notifyActive;
+ TQ_INT8 notifyActive;
args >> notifyActive;
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if ( conn ) {
if ( notifyActive )
conn->notifyRegister++;
@@ -1507,7 +1507,7 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
return true;
}
} else if ( fun == "connectSignal(TQCString,TQCString,TQCString,TQCString,TQCString,bool)") {
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if (!conn) return false;
TQDataStream args(data, IO_ReadOnly );
if (args.atEnd()) return false;
@@ -1516,16 +1516,16 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
TQCString signal = readQCString(args);
TQCString receiverObj = readQCString(args);
TQCString slot = readQCString(args);
- Q_INT8 Volatile;
+ TQ_INT8 Volatile;
args >> Volatile;
//qDebug("DCOPServer: connectSignal(sender = %s senderObj = %s signal = %s recvObj = %s slot = %s)", sender.data(), senderObj.data(), signal.data(), receiverObj.data(), slot.data());
bool b = dcopSignals->connectSignal(sender, senderObj, signal, conn, receiverObj, slot, (Volatile != 0));
replyType = "bool";
TQDataStream reply( replyData, IO_WriteOnly );
- reply << (Q_INT8) (b?1:0);
+ reply << (TQ_INT8) (b?1:0);
return true;
} else if ( fun == "disconnectSignal(TQCString,TQCString,TQCString,TQCString,TQCString)") {
- DCOPConnection* conn = clients.find( iceConn );
+ DCOPConnection* conn = clients.tqfind( iceConn );
if (!conn) return false;
TQDataStream args(data, IO_ReadOnly );
if (args.atEnd()) return false;
@@ -1538,7 +1538,7 @@ bool DCOPServer::receive(const TQCString &/*app*/, const TQCString &obj,
bool b = dcopSignals->disconnectSignal(sender, senderObj, signal, conn, receiverObj, slot);
replyType = "bool";
TQDataStream reply( replyData, IO_WriteOnly );
- reply << (Q_INT8) (b?1:0);
+ reply << (TQ_INT8) (b?1:0);
return true;
}
@@ -1618,7 +1618,7 @@ static bool isRunning(const TQCString &fName, bool printNetworkId = false)
TQCString contents( size+1 );
bool ok = f.readBlock( contents.data(), size ) == size;
contents[size] = '\0';
- int pos = contents.find('\n');
+ int pos = contents.tqfind('\n');
ok = ok && ( pos != -1 );
pid_t pid = ok ? contents.mid(pos+1).toUInt(&ok) : 0;
f.close();
@@ -1739,7 +1739,7 @@ extern "C" DCOP_EXPORT int kdemain( int argc, char* argv[] )
return 0;
}
qWarning("DCOPServer self-test failed.");
- system(findDcopserverShutdown()+" --kill");
+ system(tqfindDcopserverShutdown()+" --kill");
return 1;
}
close(ready[0]);