summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/gubed/quantadebuggergubed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/components/debugger/gubed/quantadebuggergubed.cpp')
-rw-r--r--quanta/components/debugger/gubed/quantadebuggergubed.cpp132
1 files changed, 66 insertions, 66 deletions
diff --git a/quanta/components/debugger/gubed/quantadebuggergubed.cpp b/quanta/components/debugger/gubed/quantadebuggergubed.cpp
index be703e73..f909832a 100644
--- a/quanta/components/debugger/gubed/quantadebuggergubed.cpp
+++ b/quanta/components/debugger/gubed/quantadebuggergubed.cpp
@@ -19,14 +19,14 @@
#include <kstreamsocket.h>
#include <klocale.h>
#include <kgenericfactory.h>
-#include <qlineedit.h>
-#include <qslider.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
+#include <tqlineedit.h>
+#include <tqslider.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
#include <kdeversion.h>
#include <errno.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
#include <stdarg.h>
@@ -47,7 +47,7 @@ K_EXPORT_COMPONENT_FACTORY( quantadebuggergubed,
const char QuantaDebuggerGubed::protocolversion[] = "0.0.12";
-QuantaDebuggerGubed::QuantaDebuggerGubed (QObject *parent, const char* name, const QStringList&)
+QuantaDebuggerGubed::QuantaDebuggerGubed (TQObject *parent, const char* name, const TQStringList&)
: DebuggerClient (parent, name)
{
// Create a socket object and set up its signals
@@ -98,10 +98,10 @@ void QuantaDebuggerGubed::startSession()
{
m_socket = new KNetwork::KStreamSocket(m_serverHost, m_serverPort);
- connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotError(int)));
- connect(m_socket, SIGNAL(connected(const KResolverEntry &)), this, SLOT(slotConnected(const KResolverEntry &)));
- connect(m_socket, SIGNAL(closed()), this, SLOT(slotConnectionClosed()));
- connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
+ connect(m_socket, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotError(int)));
+ connect(m_socket, TQT_SIGNAL(connected(const KResolverEntry &)), this, TQT_SLOT(slotConnected(const KResolverEntry &)));
+ connect(m_socket, TQT_SIGNAL(closed()), this, TQT_SLOT(slotConnectionClosed()));
+ connect(m_socket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotReadyRead()));
m_socket->connect();
debuggerInterface()->enableAction("debug_connect", true);
@@ -119,7 +119,7 @@ void QuantaDebuggerGubed::startSession()
m_server = new KNetwork::KServerSocket(m_listenPort);
m_server->setAddressReuseable(true);
- connect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+ connect(m_server, TQT_SIGNAL(readyAccept()), this, TQT_SLOT(slotReadyAccept()));
if(m_server->listen())
{
@@ -280,7 +280,7 @@ void QuantaDebuggerGubed::slotReadyAccept()
{
// Perhaps this shouldnt be disconnected - instead check if connections are available at disconnect?
- disconnect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+ disconnect(m_server, TQT_SIGNAL(readyAccept()), this, TQT_SLOT(slotReadyAccept()));
m_socket = (KNetwork::KStreamSocket *)m_server->accept(); // KSocketServer returns a KStreamSocket (!)
if(m_socket)
@@ -288,10 +288,10 @@ void QuantaDebuggerGubed::slotReadyAccept()
kdDebug(24002) << k_funcinfo << ", ready" << endl;
m_socket->enableRead(true);
- connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotError(int)));
- connect(m_socket, SIGNAL(connected(const KResolverEntry &)), this, SLOT(slotConnected(const KResolverEntry &)));
- connect(m_socket, SIGNAL(closed()), this, SLOT(slotConnectionClosed()));
- connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
+ connect(m_socket, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotError(int)));
+ connect(m_socket, TQT_SIGNAL(connected(const KResolverEntry &)), this, TQT_SLOT(slotConnected(const KResolverEntry &)));
+ connect(m_socket, TQT_SIGNAL(closed()), this, TQT_SLOT(slotConnectionClosed()));
+ connect(m_socket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotReadyRead()));
connected();
emit updateStatus(DebuggerUI::Connected);
@@ -339,7 +339,7 @@ void QuantaDebuggerGubed::slotConnectionClosed()
}
if(m_server)
- connect(m_server, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept()));
+ connect(m_server, TQT_SIGNAL(readyAccept()), this, TQT_SLOT(slotReadyAccept()));
// Disable all session related actions and enable connection action
debuggerInterface()->enableAction("*", false);
@@ -365,7 +365,7 @@ void QuantaDebuggerGubed::slotReadyRead()
while(m_socket && (m_socket->bytesAvailable() > 0 || m_buffer.length() >= (unsigned long)m_datalen))
{
int bytes;
- QString data;
+ TQString data;
if(m_socket && m_socket->bytesAvailable() > 0)
{
@@ -408,7 +408,7 @@ void QuantaDebuggerGubed::slotReadyRead()
}
// Process a gubed command
-void QuantaDebuggerGubed::processCommand(const QString& datas)
+void QuantaDebuggerGubed::processCommand(const TQString& datas)
{
kdDebug(24002) << k_funcinfo << ", " << m_command << " : " << datas.left(50) << endl;
StringMap args = parseArgs(datas);
@@ -429,7 +429,7 @@ void QuantaDebuggerGubed::processCommand(const QString& datas)
else if(m_command == "getrunmode")
{
debuggingState(true);
- sendCommand("setdisplaydelay", "newdelay", QString::number(m_displaydelay).ascii(), (char*)0L);
+ sendCommand("setdisplaydelay", "newdelay", TQString::number(m_displaydelay).ascii(), (char*)0L);
if(m_executionState == Pause)
sendCommand("pause", (char*)0L);
else if(m_executionState == Run)
@@ -437,15 +437,15 @@ void QuantaDebuggerGubed::processCommand(const QString& datas)
else if(m_executionState == Trace)
sendCommand("trace", (char*)0L);
- sendCommand("seterrormask", "errormask", QString::number(m_errormask).ascii(), (char*)0L);
+ sendCommand("seterrormask", "errormask", TQString::number(m_errormask).ascii(), (char*)0L);
}
// Just some status info, display on status line
else if(m_command == "status")
{
long argcnt = args["args"].toLong();
- QString msg = i18n(args["message"]); // How will we get these messages throught to the translators?
+ TQString msg = i18n(args["message"]); // How will we get these messages throught to the translators?
for(int cnt = 1; cnt <= argcnt; cnt++)
- msg.replace("%" + QString("%1").arg(cnt) + "%", args[QString("arg%1").arg(cnt)]);
+ msg.replace("%" + TQString("%1").arg(cnt) + "%", args[TQString("arg%1").arg(cnt)]);
debuggerInterface()->showStatus(msg, false);
}
@@ -588,28 +588,28 @@ void QuantaDebuggerGubed::sendBreakpoints()
}
void QuantaDebuggerGubed::sendWatches()
{
- for(QValueList<QString>::iterator it = m_watchlist.begin(); it != m_watchlist.end(); ++it)
+ for(TQValueList<TQString>::iterator it = m_watchlist.begin(); it != m_watchlist.end(); ++it)
sendCommand("getwatch", "variable", (*it).ascii(), (char*)0L);
sendCommand("sentwatches", "key", (char*)0L, (char*)0L);
}
// Send a command to gubed
-bool QuantaDebuggerGubed::sendCommand(const QString& command, StringMap args)
+bool QuantaDebuggerGubed::sendCommand(const TQString& command, StringMap args)
{
kdDebug(24002) << k_lineinfo << ", command " << command << " with data: " << phpSerialize(args) << endl;
if(!m_socket || m_socket->state() != KNetwork::KClientSocketBase::Connected)
return false;
- QString buffer = phpSerialize(args);
+ TQString buffer = phpSerialize(args);
- buffer = QString(command + ":%1;" + buffer).arg(buffer.length());
+ buffer = TQString(command + ":%1;" + buffer).arg(buffer.length());
m_socket->writeBlock(buffer, buffer.length());
return true;
}
// Send a command to gubed
-bool QuantaDebuggerGubed::sendCommand(const QString& command, char * firstarg, ...)
+bool QuantaDebuggerGubed::sendCommand(const TQString& command, char * firstarg, ...)
{
StringMap ca;
char *next;
@@ -620,7 +620,7 @@ bool QuantaDebuggerGubed::sendCommand(const QString& command, char * firstarg, .
next = firstarg;
while(next)
{
- ca[(QString)next] = (QString)va_arg(l_Arg, char*);
+ ca[(TQString)next] = (TQString)va_arg(l_Arg, char*);
// kdDebug(24002) << k_lineinfo << " Added arg/valuepair " << next << ", " << ca[next].left(30) << endl;
next = va_arg(l_Arg, char*);
}
@@ -631,12 +631,12 @@ bool QuantaDebuggerGubed::sendCommand(const QString& command, char * firstarg, .
}
// Return name of debugger
-QString QuantaDebuggerGubed::getName()
+TQString QuantaDebuggerGubed::getName()
{
return "Gubed"; // no i18n on the name
}
-void QuantaDebuggerGubed::showWatch(const QString& data)
+void QuantaDebuggerGubed::showWatch(const TQString& data)
{
debuggerInterface()->showVariable(parsePHPVariables(data));
}
@@ -644,7 +644,7 @@ void QuantaDebuggerGubed::showWatch(const QString& data)
// Send HTTP Request
void QuantaDebuggerGubed::request()
{
- QString request;
+ TQString request;
request = debuggerInterface()->activeFileParts(m_startsession);
//if(request.startsWith(m_localBasedir, false))
@@ -711,7 +711,7 @@ void QuantaDebuggerGubed::pause()
// Add a breakpoint
void QuantaDebuggerGubed::addBreakpoint (DebuggerBreakpoint* breakpoint)
{
- QString type;
+ TQString type;
if(breakpoint->type() == DebuggerBreakpoint::LineBreakpoint)
type = "line";
else if(breakpoint->type() == DebuggerBreakpoint::ConditionalTrue)
@@ -725,13 +725,13 @@ void QuantaDebuggerGubed::addBreakpoint (DebuggerBreakpoint* breakpoint)
"class", breakpoint->inClass().ascii(),
"function", breakpoint->inFunction().ascii(),
"expression", breakpoint->condition().ascii(),
- "line", QString::number(breakpoint->line()).ascii(),
+ "line", TQString::number(breakpoint->line()).ascii(),
(char *)0L);
}
-// QString QuantaDebuggerGubed::bpToGubed(DebuggerBreakpoint* breakpoint)
+// TQString QuantaDebuggerGubed::bpToGubed(DebuggerBreakpoint* breakpoint)
// {
-// return QString("^" + mapLocalPathToServer(breakpoint->filePath()) +
+// return TQString("^" + mapLocalPathToServer(breakpoint->filePath()) +
// "^" + breakpoint->inClass() +
// "^" + breakpoint->inFunction() +
// "^" + (breakpoint->type() == DebuggerBreakpoint::ConditionalTrue ? "true" : "change") +
@@ -741,7 +741,7 @@ void QuantaDebuggerGubed::addBreakpoint (DebuggerBreakpoint* breakpoint)
// Clear a breakpoint
void QuantaDebuggerGubed::removeBreakpoint(DebuggerBreakpoint* breakpoint)
{
- QString type;
+ TQString type;
if(breakpoint->type() == DebuggerBreakpoint::LineBreakpoint)
type = "line";
else if(breakpoint->type() == DebuggerBreakpoint::ConditionalTrue)
@@ -755,18 +755,18 @@ void QuantaDebuggerGubed::removeBreakpoint(DebuggerBreakpoint* breakpoint)
"class", breakpoint->inClass().ascii(),
"function", breakpoint->inFunction().ascii(),
"expression", breakpoint->condition().ascii(),
- "line", QString::number(breakpoint->line()).ascii(),
+ "line", TQString::number(breakpoint->line()).ascii(),
(char*)0L);
}
// A file was opened...
-void QuantaDebuggerGubed::fileOpened(const QString&)
+void QuantaDebuggerGubed::fileOpened(const TQString&)
{
sendCommand("reinitialize", (char*)0L);
}
// Watch a variable
-void QuantaDebuggerGubed::addWatch(const QString &variable)
+void QuantaDebuggerGubed::addWatch(const TQString &variable)
{
if(m_watchlist.find(variable) == m_watchlist.end())
m_watchlist.append(variable);
@@ -798,10 +798,10 @@ void QuantaDebuggerGubed::showCondition(const StringMap &args)
}
// Read configuration
-void QuantaDebuggerGubed::readConfig(QDomNode node)
+void QuantaDebuggerGubed::readConfig(TQDomNode node)
{
// Server
- QDomNode valuenode = node.namedItem("serverhost");
+ TQDomNode valuenode = node.namedItem("serverhost");
m_serverHost = valuenode.firstChild().nodeValue();
if(m_serverHost.isEmpty())
m_serverHost = "localhost";
@@ -850,7 +850,7 @@ void QuantaDebuggerGubed::readConfig(QDomNode node)
// Show configuration
-void QuantaDebuggerGubed::showConfig(QDomNode node)
+void QuantaDebuggerGubed::showConfig(TQDomNode node)
{
GubedSettings set(protocolversion);
@@ -872,9 +872,9 @@ void QuantaDebuggerGubed::showConfig(QDomNode node)
set.checkBreakOnUserWarning->setChecked(QuantaDebuggerGubed::User_Warning & m_errormask);
set.checkBreakOnUserError->setChecked(QuantaDebuggerGubed::User_Error & m_errormask);
- if(set.exec() == QDialog::Accepted )
+ if(set.exec() == TQDialog::Accepted )
{
- QDomElement el;
+ TQDomElement el;
el = node.namedItem("serverhost").toElement();
if (!el.isNull())
@@ -942,7 +942,7 @@ void QuantaDebuggerGubed::showConfig(QDomNode node)
el = node.ownerDocument().createElement("defaultexecutionstate");
node.appendChild( el );
m_defaultExecutionState = (State)set.comboDefaultExecutionState->currentItem();
- el.appendChild(node.ownerDocument().createTextNode(QString::number(m_defaultExecutionState)));
+ el.appendChild(node.ownerDocument().createTextNode(TQString::number(m_defaultExecutionState)));
el = node.namedItem("displaydelay").toElement();
@@ -951,7 +951,7 @@ void QuantaDebuggerGubed::showConfig(QDomNode node)
el = node.ownerDocument().createElement("displaydelay");
node.appendChild( el );
m_displaydelay = set.sliderDisplayDelay->value();
- el.appendChild( node.ownerDocument().createTextNode(QString::number(m_displaydelay)));
+ el.appendChild( node.ownerDocument().createTextNode(TQString::number(m_displaydelay)));
el = node.namedItem("errormask").toElement();
if (!el.isNull())
@@ -964,20 +964,20 @@ void QuantaDebuggerGubed::showConfig(QDomNode node)
+ (set.checkBreakOnUserWarning->isChecked() ? QuantaDebuggerGubed::User_Warning : 0)
+ (set.checkBreakOnUserError->isChecked() ? QuantaDebuggerGubed::User_Error : 0);
kdDebug(24002) << k_funcinfo << ", m_errormask = " << m_errormask << endl;
- el.appendChild( node.ownerDocument().createTextNode(QString::number(m_errormask)));
+ el.appendChild( node.ownerDocument().createTextNode(TQString::number(m_errormask)));
}
}
// Map a server filepath to a local one using project settings
-QString QuantaDebuggerGubed::mapServerPathToLocal(const QString& serverpath)
+TQString QuantaDebuggerGubed::mapServerPathToLocal(const TQString& serverpath)
{
// Translate filename from server to local
return debuggerInterface()->Mapper()->mapServerPathToLocal(serverpath);
}
// Map a local filepath to a server one using project settings
-QString QuantaDebuggerGubed::mapLocalPathToServer(const QString& localpath)
+TQString QuantaDebuggerGubed::mapLocalPathToServer(const TQString& localpath)
{
// Translate filename from local to server
return debuggerInterface()->Mapper()->mapLocalPathToServer(localpath);
@@ -991,23 +991,23 @@ void QuantaDebuggerGubed::variableSetValue(const DebuggerVariable &variable)
(char*)0L);
}
-QString QuantaDebuggerGubed::phpSerialize(StringMap args)
+TQString QuantaDebuggerGubed::phpSerialize(StringMap args)
{
StringMap::Iterator it;
// a:2:{s:4:"name";s:7:"Jessica";s:3:"age";s:2:"26";s:4:"test";i:1;}
- QString ret = QString("a:%1:{").arg(args.size());
+ TQString ret = TQString("a:%1:{").arg(args.size());
for( it = args.begin(); it != args.end(); ++it )
{
bool isNumber;
it.data().toInt(&isNumber);
if(isNumber && !it.data().isEmpty())
- ret += QString("s:%1:\"%2\";i:%3;")
+ ret += TQString("s:%1:\"%2\";i:%3;")
.arg(it.key().length())
.arg(it.key())
.arg(it.data());
else
- ret += QString("s:%1:\"%2\";s:%3:\"%4\";")
+ ret += TQString("s:%1:\"%2\";s:%3:\"%4\";")
.arg(it.key().length())
.arg(it.key())
.arg(it.data().length())
@@ -1020,7 +1020,7 @@ QString QuantaDebuggerGubed::phpSerialize(StringMap args)
}
-StringMap QuantaDebuggerGubed::parseArgs(const QString &args)
+StringMap QuantaDebuggerGubed::parseArgs(const TQString &args)
{
StringMap ca;
long cnt, length;
@@ -1039,9 +1039,9 @@ StringMap QuantaDebuggerGubed::parseArgs(const QString &args)
}
cnt = args.mid(2, args.find("{") - 3).toLong();
- QString data = args.mid(args.find("{") + 1);
+ TQString data = args.mid(args.find("{") + 1);
- QString tmp, func;
+ TQString tmp, func;
while(cnt > 0)
{
tmp = data.left(data.find("\""));
@@ -1076,22 +1076,22 @@ StringMap QuantaDebuggerGubed::parseArgs(const QString &args)
return ca;
}
-DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(const QString &varstring)
+DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(const TQString &varstring)
{
- QString str = varstring;
+ TQString str = varstring;
DebuggerVariable* var = parsePHPVariables(str);
return var;
}
-DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(QString &str)
+DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(TQString &str)
{
- QString key, data;
- QString tempstring;
+ TQString key, data;
+ TQString tempstring;
int length;
DebuggerVariable* debuggervar = NULL;
// get type of key
- QString type = str.left(1);
+ TQString type = str.left(1);
str.remove(0, 2);
// Strings
@@ -1172,7 +1172,7 @@ DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(QString &str)
str.remove(0, str.find(':') + 2);
length = tempstring.toUInt();
- QPtrList<DebuggerVariable> vars ;
+ TQPtrList<DebuggerVariable> vars ;
while(length > 0)
{
//kdDebug(24002) << "VariablesListView::parsePHPVariables: length " << length << ", \"" << str << "\"" << endl;
@@ -1201,7 +1201,7 @@ DebuggerVariable* QuantaDebuggerGubed::parsePHPVariables(QString &str)
str.remove(0, str.find('{') + 1);
- QPtrList<DebuggerVariable> vars ;
+ TQPtrList<DebuggerVariable> vars ;
while(length > 0)
{
//kdDebug(24002) << "VariablesListView::parsePHPVariables: length " << length << ", \"" << str << "\"" << endl;