From dc6b8e72fed2586239e3514819238c520636c9d9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:54:04 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- klinkstatus/src/global.cpp | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'klinkstatus/src/global.cpp') diff --git a/klinkstatus/src/global.cpp b/klinkstatus/src/global.cpp index 10395f7b..cfbfe910 100644 --- a/klinkstatus/src/global.cpp +++ b/klinkstatus/src/global.cpp @@ -11,8 +11,8 @@ // #include "global.h" -#include -#include +#include +#include #include #include @@ -40,8 +40,8 @@ Global* Global::self() return m_self_; } -Global::Global(QObject *parent, const char *name) - : QObject(parent, name), loop_started_(false) +Global::Global(TQObject *parent, const char *name) + : TQObject(parent, name), loop_started_(false) { m_self_ = this; dcop_client_ = kapp->dcopClient(); @@ -55,7 +55,7 @@ Global::~Global() bool Global::isKLinkStatusEmbeddedInQuanta() { - QCString app_id = "quanta-" + QCString().setNum(getpid()); + TQCString app_id = "quanta-" + TQCString().setNum(getpid()); return self()->dcop_client_->isApplicationRegistered(app_id); } @@ -72,7 +72,7 @@ bool Global::isQuantaAvailableViaDCOP() else { self()->execCommand("ps h -o pid -C quanta -C quanta_be"); - QStringList ps_list = QStringList::split("\n", self()->script_output_); + TQStringList ps_list = TQStringList::split("\n", self()->script_output_); for(uint i = 0; i != ps_list.size(); ++i) { @@ -87,25 +87,25 @@ bool Global::isQuantaAvailableViaDCOP() } } -QCString Global::quantaDCOPAppId() +TQCString Global::quantaDCOPAppId() { DCOPClient* client = kapp->dcopClient(); - QCString app_id; + TQCString app_id; if(client->isApplicationRegistered("quanta")) // quanta is unnique application app_id = "quanta"; else if(self()->isKLinkStatusEmbeddedInQuanta()) // klinkstatus is running as a part inside quanta { - QCString app = "quanta-"; - QCString pid = QCString().setNum(getpid()); + TQCString app = "quanta-"; + TQCString pid = TQCString().setNum(getpid()); app_id = app + pid; } else { self()->execCommand("ps h -o pid -C quanta -C quanta_be"); - QStringList ps_list = QStringList::split("\n", self()->script_output_); + TQStringList ps_list = TQStringList::split("\n", self()->script_output_); for(uint i = 0; i != ps_list.size(); ++i) { @@ -129,32 +129,32 @@ KURL Global::urlWithQuantaPreviewPrefix(KURL const& url) Q_ASSERT(isKLinkStatusEmbeddedInQuanta()); DCOPRef quanta(Global::quantaDCOPAppId(),"WindowManagerIf"); - QString string_url_with_prefix = quanta.call("urlWithPreviewPrefix", url.url()); + TQString string_url_with_prefix = quanta.call("urlWithPreviewPrefix", url.url()); //kdDebug(23100) << "string_url_with_prefix: " << string_url_with_prefix << endl; return KURL(string_url_with_prefix); } -void Global::openQuanta(QStringList const& args) +void Global::openQuanta(TQStringList const& args) { - QString command(args.join(" ")); + TQString command(args.join(" ")); Global::execCommand("quanta " + command); } -void Global::execCommand(QString const& command) +void Global::execCommand(TQString const& command) { //We create a KProcess that executes the "ps" *nix command to get the PIDs of the //other instances of quanta actually running self()->process_PS_ = new KProcess(); - *(self()->process_PS_) << QStringList::split(" ",command); + *(self()->process_PS_) << TQStringList::split(" ",command); - connect( self()->process_PS_, SIGNAL(receivedStdout(KProcess*,char*,int)), - self(), SLOT(slotGetScriptOutput(KProcess*,char*,int))); - connect( self()->process_PS_, SIGNAL(receivedStderr(KProcess*,char*,int)), - self(), SLOT(slotGetScriptError(KProcess*,char*,int))); - connect( self()->process_PS_, SIGNAL(processExited(KProcess*)), - self(), SLOT(slotProcessExited(KProcess*))); + connect( self()->process_PS_, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), + self(), TQT_SLOT(slotGetScriptOutput(KProcess*,char*,int))); + connect( self()->process_PS_, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), + self(), TQT_SLOT(slotGetScriptError(KProcess*,char*,int))); + connect( self()->process_PS_, TQT_SIGNAL(processExited(KProcess*)), + self(), TQT_SLOT(slotProcessExited(KProcess*))); //if KProcess fails I think a message box is needed... I will fix it if (!self()->process_PS_->start(KProcess::NotifyOnExit,KProcess::All)) @@ -163,9 +163,9 @@ void Global::execCommand(QString const& command) else { //To avoid lock-ups, start a timer. - QTimer* timer = new QTimer(self()); - connect(timer, SIGNAL(timeout()), - self(), SLOT(slotProcessTimeout())); + TQTimer* timer = new TQTimer(self()); + connect(timer, TQT_SIGNAL(timeout()), + self(), TQT_SLOT(slotProcessTimeout())); timer->start(120*1000, true); self()->loop_started_ = true; kapp->enter_loop(); @@ -175,9 +175,9 @@ void Global::execCommand(QString const& command) void Global::slotGetScriptOutput(KProcess* /*process*/, char* buf, int buflen) { - QCString tmp( buf, buflen + 1 ); - script_output_ = QString::null; - script_output_ = QString::fromLocal8Bit(tmp).remove(" "); + TQCString tmp( buf, buflen + 1 ); + script_output_ = TQString::null; + script_output_ = TQString::fromLocal8Bit(tmp).remove(" "); } void Global::slotGetScriptError(KProcess*, char* buf, int buflen) -- cgit v1.2.1