summaryrefslogtreecommitdiffstats
path: root/src/kvilib/ext/kvi_dcophelper.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib/ext/kvi_dcophelper.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib/ext/kvi_dcophelper.cpp')
-rw-r--r--src/kvilib/ext/kvi_dcophelper.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/src/kvilib/ext/kvi_dcophelper.cpp b/src/kvilib/ext/kvi_dcophelper.cpp
index 83f34f4e..7528c5a7 100644
--- a/src/kvilib/ext/kvi_dcophelper.cpp
+++ b/src/kvilib/ext/kvi_dcophelper.cpp
@@ -30,15 +30,15 @@
#include "dcopclient.h"
-#include <qdatastream.h>
-#include <qvaluelist.h>
+#include <tqdatastream.h>
+#include <tqvaluelist.h>
// must be included this way, since kvilib is built
// before kvirc and symlinks to headers aren't set yet
#include "../../kvirc/kernel/kvi_app.h"
#include "kvi_thread.h"
-KviDCOPHelper::KviDCOPHelper(bool bStartApp, const KviQCString &szAppId)
+KviDCOPHelper::KviDCOPHelper(bool bStartApp, const KviTQCString &szAppId)
{
m_szAppId = szAppId;
}
@@ -47,7 +47,7 @@ KviDCOPHelper::~KviDCOPHelper()
{
}
-bool KviDCOPHelper::ensureAppRunning(const QString &szApp)
+bool KviDCOPHelper::ensureAppRunning(const TQString &szApp)
{
if (findRunningApp(m_szAppId))
return true;
@@ -59,79 +59,79 @@ bool KviDCOPHelper::ensureAppRunning(const QString &szApp)
}
-bool KviDCOPHelper::voidRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc)
+bool KviDCOPHelper::voidRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
+ TQByteArray data;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::voidRetBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal)
+bool KviDCOPHelper::voidRetBoolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool bVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
arg << bVal;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::voidRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal)
+bool KviDCOPHelper::voidRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::voidRetIntBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal, bool bVal)
+bool KviDCOPHelper::voidRetIntBoolDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal, bool bVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal;
arg << bVal;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::voidRetIntIntIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal1, int iVal2, int iVal3)
+bool KviDCOPHelper::voidRetIntIntIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int iVal1, int iVal2, int iVal3)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal1;
arg << iVal2;
arg << iVal3;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::voidRetFloatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal)
+bool KviDCOPHelper::voidRetFloatDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,float fVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
arg << fVal;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::voidRetStringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,const QString &szVal)
+bool KviDCOPHelper::voidRetStringDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,const TQString &szVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
arg << szVal;
return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data);
}
-bool KviDCOPHelper::stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet)
+bool KviDCOPHelper::stringRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &szRet)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
- QDataStream reply( replyData, IO_ReadOnly );
- if(replyType == "QString")
+ TQDataStream reply( replyData, IO_ReadOnly );
+ if(replyType == TQSTRING_OBJECT_NAME_STRING)
{
reply >> szRet;
return true;
@@ -139,20 +139,20 @@ bool KviDCOPHelper::stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCSt
return false;
}
-bool KviDCOPHelper::stringRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet,int iVal)
+bool KviDCOPHelper::stringRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &szRet,int iVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
- QDataStream arg(data, IO_WriteOnly);
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal;
if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
- QDataStream reply( replyData, IO_ReadOnly );
- if(replyType == "QString")
+ TQDataStream reply( replyData, IO_ReadOnly );
+ if(replyType == TQSTRING_OBJECT_NAME_STRING)
{
reply >> szRet;
return true;
@@ -160,14 +160,14 @@ bool KviDCOPHelper::stringRetIntDCOPCall(const KviQCString &szObj,const KviQCStr
return false;
}
-bool KviDCOPHelper::intRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret)
+bool KviDCOPHelper::intRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
- QDataStream reply( replyData, IO_ReadOnly );
+ TQDataStream reply( replyData, IO_ReadOnly );
if(replyType == "int")
{
reply >> ret;
@@ -176,19 +176,19 @@ bool KviDCOPHelper::intRetVoidDCOPCall(const KviQCString &szObj,const KviQCStrin
return false;
}
-bool KviDCOPHelper::intRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret, int iVal)
+bool KviDCOPHelper::intRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret, int iVal)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
- QDataStream arg(data, IO_WriteOnly);
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal;
if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
- QDataStream reply( replyData, IO_ReadOnly );
+ TQDataStream reply( replyData, IO_ReadOnly );
if(replyType == "int")
{
reply >> ret;
@@ -197,14 +197,14 @@ bool KviDCOPHelper::intRetIntDCOPCall(const KviQCString &szObj,const KviQCString
return false;
}
-bool KviDCOPHelper::boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret)
+bool KviDCOPHelper::boolRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool &ret)
{
if(!ensureAppRunning(m_szAppId))return false;
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
- QDataStream reply( replyData, IO_ReadOnly );
+ TQDataStream reply( replyData, IO_ReadOnly );
if(replyType == "bool")
{
reply >> ret;
@@ -213,14 +213,14 @@ bool KviDCOPHelper::boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCStri
return false;
}
-bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviValueList<int> &ret, int iVal)
+bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviValueList<int> &ret, int iVal)
{
if(!ensureAppRunning(m_szAppId))
return false;
- QByteArray data, replyData;
- KviQCString replyType;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data, replyData;
+ KviTQCString replyType;
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal;
@@ -228,19 +228,19 @@ bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const K
if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
- if(replyType != "QValueList<int>")
+ if(replyType != "TQValueList<int>")
return false;
- QDataStream replyStream(replyData, IO_ReadOnly);
+ TQDataStream replyStream(replyData, IO_ReadOnly);
replyStream >> ret;
return true;
}
-bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret)
+bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviQCStringList &ret)
{
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
if (!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
return false;
@@ -248,18 +248,18 @@ bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviQCString &szObj,const K
if (replyType != "KviQCStringList")
return false;
- QDataStream replyStream(replyData, IO_ReadOnly);
+ TQDataStream replyStream(replyData, IO_ReadOnly);
replyStream >> ret;
return true;
}
-bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret, int iVal)
+bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,KviQCStringList &ret, int iVal)
{
- QByteArray data, replyData;
- KviQCString replyType;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
- QDataStream arg(data, IO_WriteOnly);
+ TQDataStream arg(data, IO_WriteOnly);
arg << iVal;
if (!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData))
@@ -268,17 +268,17 @@ bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviQCString &szObj,const Kv
if (replyType != "KviQCStringList")
return false;
- QDataStream replyStream(replyData, IO_ReadOnly);
+ TQDataStream replyStream(replyData, IO_ReadOnly);
replyStream >> ret;
return true;
}
-bool KviDCOPHelper::findRunningApp(const QString &szApp)
+bool KviDCOPHelper::findRunningApp(const TQString &szApp)
{
- QValueList<KviQCString> allApps = g_pApp->dcopClient() ->registeredApplications();
- QValueList<KviQCString>::iterator iterator;
- KviQCString sz = szApp.local8Bit();
+ TQValueList<KviTQCString> allApps = g_pApp->dcopClient() ->registeredApplications();
+ TQValueList<KviTQCString>::iterator iterator;
+ KviTQCString sz = szApp.local8Bit();
for (iterator = allApps.begin();iterator != allApps.end();iterator++)
{
if(*iterator == sz)
@@ -287,7 +287,7 @@ bool KviDCOPHelper::findRunningApp(const QString &szApp)
return false;
}
-int KviDCOPHelper::detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted)
+int KviDCOPHelper::detectApp(const TQString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted)
{
// dcop available
if(!g_pApp->dcopClient())
@@ -309,30 +309,30 @@ int KviDCOPHelper::detectApp(const QString &szApp,bool bStart,int iScoreWhenFoun
}
-bool KviDCOPHelper::startApp(const QString &szApp,int iWaitMSecs)
+bool KviDCOPHelper::startApp(const TQString &szApp,int iWaitMSecs)
{
// we could use KApplication::startServiceByDesktopName here
// but we want to be able to wait a defined amount of time
- QStringList tmp;
- QByteArray data, replyData;
- KviQCString replyType;
- QDataStream arg(data, IO_WriteOnly);
+ TQStringList tmp;
+ TQByteArray data, replyData;
+ KviTQCString replyType;
+ TQDataStream arg(data, IO_WriteOnly);
arg << szApp << tmp;
if(!g_pApp->dcopClient()->call(
"klauncher",
"klauncher",
- "start_service_by_desktop_name(QString,QStringList)",
+ "start_service_by_desktop_name(TQString,TQStringList)",
data,
replyType,
replyData))
{
return false;
} else {
- QDataStream reply(replyData, IO_ReadOnly);
+ TQDataStream reply(replyData, IO_ReadOnly);
if(replyType != "serviceResult")return false;
int result;
- KviQCString dcopName;
- QString error;
+ KviTQCString dcopName;
+ TQString error;
reply >> result >> dcopName >> error;
if(result != 0)return false;
}