From 0a80cfd57d271dd44221467efb426675fa470356 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 18:31:12 +0000 Subject: 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 --- src/modules/mediaplayer/mp_dcopinterface.cpp | 96 ++++++++++++++-------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/modules/mediaplayer/mp_dcopinterface.cpp') diff --git a/src/modules/mediaplayer/mp_dcopinterface.cpp b/src/modules/mediaplayer/mp_dcopinterface.cpp index 7c86e420..1f18b3af 100644 --- a/src/modules/mediaplayer/mp_dcopinterface.cpp +++ b/src/modules/mediaplayer/mp_dcopinterface.cpp @@ -28,13 +28,13 @@ #include "dcopclient.h" -#include -#include +#include +#include #include "kvi_app.h" #include "kvi_thread.h" -KviMediaPlayerDCOPInterface::KviMediaPlayerDCOPInterface(const KviQCString &szAppId) +KviMediaPlayerDCOPInterface::KviMediaPlayerDCOPInterface(const KviTQCString &szAppId) : KviMediaPlayerInterface() { m_szAppId = szAppId; @@ -44,66 +44,66 @@ KviMediaPlayerDCOPInterface::~KviMediaPlayerDCOPInterface() { } -bool KviMediaPlayerDCOPInterface::ensureAppRunning(const QString &szApp) +bool KviMediaPlayerDCOPInterface::ensureAppRunning(const TQString &szApp) { if(findRunningApp(m_szAppId))return true; return startApp(m_szAppId,400); } -bool KviMediaPlayerDCOPInterface::simpleDCOPCall(const KviQCString &szObj,const KviQCString &szFunc) +bool KviMediaPlayerDCOPInterface::simpleDCOPCall(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 KviMediaPlayerDCOPInterface::boolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal) +bool KviMediaPlayerDCOPInterface::boolDCOPCall(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 KviMediaPlayerDCOPInterface::intDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal) +bool KviMediaPlayerDCOPInterface::intDCOPCall(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 KviMediaPlayerDCOPInterface::floatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal) +bool KviMediaPlayerDCOPInterface::floatDCOPCall(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 KviMediaPlayerDCOPInterface::stringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString szVal) +bool KviMediaPlayerDCOPInterface::stringDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,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 KviMediaPlayerDCOPInterface::stringRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &ret) +bool KviMediaPlayerDCOPInterface::stringRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,TQString &ret) { if(!ensureAppRunning(m_szAppId))return false; - QString title; - QByteArray data, replyData; - KviQCString replyType; + TQString title; + 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 >> ret; return true; @@ -111,15 +111,15 @@ bool KviMediaPlayerDCOPInterface::stringRetDCOPCall(const KviQCString &szObj,con return false; } -bool KviMediaPlayerDCOPInterface::intRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret) +bool KviMediaPlayerDCOPInterface::intRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,int &ret) { if(!ensureAppRunning(m_szAppId))return false; - QString title; - QByteArray data, replyData; - KviQCString replyType; + TQString title; + 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; @@ -128,15 +128,15 @@ bool KviMediaPlayerDCOPInterface::intRetDCOPCall(const KviQCString &szObj,const return false; } -bool KviMediaPlayerDCOPInterface::boolRetDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret) +bool KviMediaPlayerDCOPInterface::boolRetDCOPCall(const KviTQCString &szObj,const KviTQCString &szFunc,bool &ret) { if(!ensureAppRunning(m_szAppId))return false; - QString title; - QByteArray data, replyData; - KviQCString replyType; + TQString title; + 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; @@ -146,11 +146,11 @@ bool KviMediaPlayerDCOPInterface::boolRetDCOPCall(const KviQCString &szObj,const } -bool KviMediaPlayerDCOPInterface::findRunningApp(const QString &szApp) +bool KviMediaPlayerDCOPInterface::findRunningApp(const TQString &szApp) { - QValueList allApps = g_pApp->dcopClient() ->registeredApplications(); - QValueList::iterator iterator; - KviQCString sz = szApp.local8Bit(); + TQValueList allApps = g_pApp->dcopClient() ->registeredApplications(); + TQValueList::iterator iterator; + KviTQCString sz = szApp.local8Bit(); for(iterator = allApps.begin();iterator != allApps.end();iterator++) { if(*iterator == sz)return true; @@ -158,7 +158,7 @@ bool KviMediaPlayerDCOPInterface::findRunningApp(const QString &szApp) return false; } -int KviMediaPlayerDCOPInterface::detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) +int KviMediaPlayerDCOPInterface::detectApp(const TQString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) { // lookup the amarok interface if(!g_pApp->dcopClient())return 0; @@ -176,30 +176,30 @@ int KviMediaPlayerDCOPInterface::detectApp(const QString &szApp,bool bStart,int } -bool KviMediaPlayerDCOPInterface::startApp(const QString &szApp,int iWaitMSecs) +bool KviMediaPlayerDCOPInterface::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; } -- cgit v1.2.1