summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz
tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp')
-rw-r--r--quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp b/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp
index 100ec9d3..d16319a9 100644
--- a/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp
+++ b/quanta/components/debugger/dbgp/quantadebuggerdbgp.cpp
@@ -22,14 +22,14 @@
#include <kmdcodec.h>
#include <kmessagebox.h>
#include <krun.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qfile.h>
-#include <qlineedit.h>
-#include <qmap.h>
-#include <qregexp.h>
-#include <qslider.h>
-#include <qstring.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqfile.h>
+#include <tqlineedit.h>
+#include <tqmap.h>
+#include <tqregexp.h>
+#include <tqslider.h>
+#include <tqstring.h>
#include <stdarg.h>
@@ -49,7 +49,7 @@ K_EXPORT_COMPONENT_FACTORY( quantadebuggerdbgp,
const char QuantaDebuggerDBGp::protocolversion[] = "1.0";
-QuantaDebuggerDBGp::QuantaDebuggerDBGp (QObject *parent, const char*, const QStringList&)
+QuantaDebuggerDBGp::QuantaDebuggerDBGp (TQObject *parent, const char*, const TQStringList&)
: DebuggerClient (parent, "DBGp")
{
// Create a socket object and set up its signals
@@ -59,10 +59,10 @@ QuantaDebuggerDBGp::QuantaDebuggerDBGp (QObject *parent, const char*, const QStr
setExecutionState(m_defaultExecutionState);
emit updateStatus(DebuggerUI::NoSession);
- connect(&m_network, SIGNAL(command(const QString&)), this, SLOT(processCommand(const QString&)));
- connect(&m_network, SIGNAL(active(bool)), this, SLOT(slotNetworkActive(bool)));
- connect(&m_network, SIGNAL(connected(bool)), this, SLOT(slotNetworkConnected(bool)));
- connect(&m_network, SIGNAL(networkError(const QString &, bool)), this, SLOT(slotNetworkError(const QString &, bool)));
+ connect(&m_network, TQT_SIGNAL(command(const TQString&)), this, TQT_SLOT(processCommand(const TQString&)));
+ connect(&m_network, TQT_SIGNAL(active(bool)), this, TQT_SLOT(slotNetworkActive(bool)));
+ connect(&m_network, TQT_SIGNAL(connected(bool)), this, TQT_SLOT(slotNetworkConnected(bool)));
+ connect(&m_network, TQT_SIGNAL(networkError(const TQString &, bool)), this, TQT_SLOT(slotNetworkError(const TQString &, bool)));
}
@@ -124,7 +124,7 @@ void QuantaDebuggerDBGp::slotNetworkConnected(bool connected)
}
-void QuantaDebuggerDBGp::slotNetworkError(const QString &errormsg, bool log)
+void QuantaDebuggerDBGp::slotNetworkError(const TQString &errormsg, bool log)
{
debuggerInterface()->showStatus(errormsg, log);
}
@@ -187,7 +187,7 @@ void QuantaDebuggerDBGp::setExecutionState( const State & state, bool forcesend
}
// Change executionstate of the script
-void QuantaDebuggerDBGp::setExecutionState(const QString &state)
+void QuantaDebuggerDBGp::setExecutionState(const TQString &state)
{
kdDebug(24002) << k_funcinfo << state << endl;
@@ -249,19 +249,19 @@ const uint QuantaDebuggerDBGp::supports(DebuggerClientCapabilities::Capabilities
// Process a dbgp command
-void QuantaDebuggerDBGp::processCommand(const QString& datas)
+void QuantaDebuggerDBGp::processCommand(const TQString& datas)
{
kdDebug(24002) << k_lineinfo << datas.left(50) << " (" << datas.length() << " bytes)" << endl;
- QDomDocument data;
+ TQDomDocument data;
data.setContent(datas);
kdDebug(24002) << datas << endl;
// Did we get a normal response?
if(data.elementsByTagName("response").count() > 0)
{
- QDomNode response = data.elementsByTagName("response").item(0);
- QString command = attribute(response, "command");
+ TQDomNode response = data.elementsByTagName("response").item(0);
+ TQString command = attribute(response, "command");
// Status command
if(command == "status")
@@ -321,7 +321,7 @@ void QuantaDebuggerDBGp::processCommand(const QString& datas)
}
else if(data.elementsByTagName("init").count() > 0)
{
- QDomNode init = data.elementsByTagName("init").item(0);
+ TQDomNode init = data.elementsByTagName("init").item(0);
initiateSession(init);
return;
}
@@ -334,7 +334,7 @@ void QuantaDebuggerDBGp::processCommand(const QString& datas)
}
-void QuantaDebuggerDBGp::initiateSession(const QDomNode& initpacket)
+void QuantaDebuggerDBGp::initiateSession(const TQDomNode& initpacket)
{
if(attribute(initpacket, "protocol_version") != protocolversion)
{
@@ -347,7 +347,7 @@ void QuantaDebuggerDBGp::initiateSession(const QDomNode& initpacket)
endSession();
return;
}
- QString path = attribute(initpacket, "fileuri");
+ TQString path = attribute(initpacket, "fileuri");
if (path.startsWith("file://"))
{
path.remove(0, 7);
@@ -369,22 +369,22 @@ void QuantaDebuggerDBGp::initiateSession(const QDomNode& initpacket)
m_network.sendCommand("feature_get", "-n quanta_initialized");
}
-void QuantaDebuggerDBGp::stackShow(const QDomNode&node)
+void QuantaDebuggerDBGp::stackShow(const TQDomNode&node)
{
bool foundlowlevel = false;
BacktraceType type;
- QString typestr;
+ TQString typestr;
// Clear backtrace
debuggerInterface()->backtraceClear();
// Add new one
- for(QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling())
+ for(TQDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling())
{
// Type isnt currently correct with xdebug
// type = (attribute(child, "type") == "file" ? File : Eval);
typestr = attribute(child, "filename");
- if(typestr.find(QRegExp(".*%28[0-9]+%29%20%3A%20eval")) >= 0)
+ if(typestr.find(TQRegExp(".*%28[0-9]+%29%20%3A%20eval")) >= 0)
type = Eval;
else
type = File;
@@ -409,10 +409,10 @@ void QuantaDebuggerDBGp::stackShow(const QDomNode&node)
}
-void QuantaDebuggerDBGp::checkSupport( const QDomNode & node )
+void QuantaDebuggerDBGp::checkSupport( const TQDomNode & node )
{
- QString feature = attribute(node, "feature_name");
- QString data = node.nodeValue();
+ TQString feature = attribute(node, "feature_name");
+ TQString data = node.nodeValue();
if(feature == "supports_async")
m_supportsasync = data.toLong();
@@ -430,7 +430,7 @@ void QuantaDebuggerDBGp::checkSupport( const QDomNode & node )
}
-QString QuantaDebuggerDBGp::attribute(const QDomNode&node, const QString &attribute)
+TQString QuantaDebuggerDBGp::attribute(const TQDomNode&node, const TQString &attribute)
{
return node.attributes().namedItem(attribute).nodeValue();
}
@@ -448,12 +448,12 @@ void QuantaDebuggerDBGp::debuggingState(bool enable)
void QuantaDebuggerDBGp::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)
m_network.sendCommand("property_get", "-n " + (*it));
}
// Return name of debugger
-QString QuantaDebuggerDBGp::getName()
+TQString QuantaDebuggerDBGp::getName()
{
return "DBGp"; // no i18n on the name
}
@@ -462,7 +462,7 @@ QString QuantaDebuggerDBGp::getName()
// Send HTTP Request
void QuantaDebuggerDBGp::request()
{
- QString request;
+ TQString request;
request = debuggerInterface()->activeFileParts(m_startsession);
//if(request.startsWith(m_localBasedir, false))
@@ -525,7 +525,7 @@ void QuantaDebuggerDBGp::pause()
// Add a breakpoint
void QuantaDebuggerDBGp::addBreakpoint (DebuggerBreakpoint* breakpoint)
{
- QString type;
+ TQString type;
if(breakpoint->type() == DebuggerBreakpoint::LineBreakpoint)
type = "line";
else if(breakpoint->type() == DebuggerBreakpoint::ConditionalTrue)
@@ -537,20 +537,20 @@ void QuantaDebuggerDBGp::addBreakpoint (DebuggerBreakpoint* breakpoint)
"breakpoint_set",
"-t " + type +
" -f " + mapLocalPathToServer(breakpoint->filePath()) +
- " -n " + QString::number(breakpoint->line() + 1)
+ " -n " + TQString::number(breakpoint->line() + 1)
, breakpoint->condition());
- breakpoint->setKey(QString("id %1").arg(id));
+ breakpoint->setKey(TQString("id %1").arg(id));
}
-void QuantaDebuggerDBGp::setBreakpointKey( const QDomNode & response )
+void QuantaDebuggerDBGp::setBreakpointKey( const TQDomNode & response )
{
long id;
id = attribute(response, "transaction_id").toLong();
if(id > 0)
{
- QString oldkey = QString("id %1").arg(id);
+ TQString oldkey = TQString("id %1").arg(id);
DebuggerBreakpoint *bp = debuggerInterface()->findDebuggerBreakpoint(oldkey);
if(bp)
debuggerInterface()->updateBreakpointKey(*bp, attribute(response, "id"));
@@ -565,13 +565,13 @@ void QuantaDebuggerDBGp::removeBreakpoint(DebuggerBreakpoint* bp)
}
// A file was opened...
-void QuantaDebuggerDBGp::fileOpened(const QString&)
+void QuantaDebuggerDBGp::fileOpened(const TQString&)
{
// sendCommand("reinitialize", 0);
}
// Watch a variable
-void QuantaDebuggerDBGp::addWatch(const QString & variable)
+void QuantaDebuggerDBGp::addWatch(const TQString & variable)
{
if(m_watchlist.find(variable) == m_watchlist.end())
m_watchlist.append(variable);
@@ -602,10 +602,10 @@ void QuantaDebuggerDBGp::showCondition(const StringMap &)
}
// Read configuration
-void QuantaDebuggerDBGp::readConfig(QDomNode node)
+void QuantaDebuggerDBGp::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";
@@ -670,7 +670,7 @@ void QuantaDebuggerDBGp::readConfig(QDomNode node)
// Show configuration
-void QuantaDebuggerDBGp::showConfig(QDomNode node)
+void QuantaDebuggerDBGp::showConfig(TQDomNode node)
{
DBGpSettings set(protocolversion);
@@ -699,9 +699,9 @@ void QuantaDebuggerDBGp::showConfig(QDomNode node)
if(m_profilerMapFilename)
set.checkProfilerMapFilename->setChecked(true);
- if(set.exec() == QDialog::Accepted )
+ if(set.exec() == TQDialog::Accepted )
{
- QDomElement el;
+ TQDomElement el;
el = node.namedItem("localproject").toElement();
if (!el.isNull())
@@ -785,7 +785,7 @@ void QuantaDebuggerDBGp::showConfig(QDomNode node)
+ (set.checkBreakOnUserWarning->isChecked() ? QuantaDebuggerDBGp::User_Warning : 0)
+ (set.checkBreakOnUserError->isChecked() ? QuantaDebuggerDBGp::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)));
// Profiler
el = node.namedItem("profilerfilename").toElement();
@@ -815,14 +815,14 @@ void QuantaDebuggerDBGp::showConfig(QDomNode node)
}
// Map a server filepath to a local one using project settings
-QString QuantaDebuggerDBGp::mapServerPathToLocal(const QString& serverpath)
+TQString QuantaDebuggerDBGp::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 QuantaDebuggerDBGp::mapLocalPathToServer(const QString& localpath)
+TQString QuantaDebuggerDBGp::mapLocalPathToServer(const TQString& localpath)
{
// Translate filename from local to server
return debuggerInterface()->Mapper()->mapLocalPathToServer(localpath);
@@ -832,7 +832,7 @@ void QuantaDebuggerDBGp::variableSetValue(const DebuggerVariable &variable)
{
m_network.sendCommand("property_set", "-n " + variable.name(), variable.value());
- 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)
if((*it) == variable.name())
{
m_network.sendCommand("property_get", "-n " + variable.name(), variable.value());
@@ -849,14 +849,14 @@ void QuantaDebuggerDBGp::profilerOpen()
void QuantaDebuggerDBGp::profilerOpen(bool forceopen)
{
- QString profileroutput = m_profilerFilename;
+ TQString profileroutput = m_profilerFilename;
profileroutput.replace("%a", m_appid);
profileroutput.replace("%c", m_initialscript);
if(m_profilerMapFilename)
profileroutput = mapServerPathToLocal( profileroutput);
- bool exists = QFile::exists(profileroutput);
+ bool exists = TQFile::exists(profileroutput);
if(m_profilerAutoOpen || forceopen)
{
if(exists)
@@ -878,7 +878,7 @@ void QuantaDebuggerDBGp::profilerOpen(bool forceopen)
}
}
-void QuantaDebuggerDBGp::typemapSetup( const QDomNode & typemapnode )
+void QuantaDebuggerDBGp::typemapSetup( const TQDomNode & typemapnode )
{
/*
<map name="bool" type="bool" xsi:type="xsd:boolean"></map>
@@ -902,7 +902,7 @@ void QuantaDebuggerDBGp::typemapSetup( const QDomNode & typemapnode )
// m_variabletypes["object"] = "object";
// m_variabletypes["resource"] = "resource";
- QDomNode child = typemapnode.firstChild();
+ TQDomNode child = typemapnode.firstChild();
while(!child.isNull())
{
if(child.nodeName() == "map")
@@ -914,12 +914,12 @@ void QuantaDebuggerDBGp::typemapSetup( const QDomNode & typemapnode )
}
-void QuantaDebuggerDBGp::showWatch( const QDomNode & variablenode)
+void QuantaDebuggerDBGp::showWatch( const TQDomNode & variablenode)
{
debuggerInterface()->showVariable(buildVariable(variablenode.firstChild()));
}
-void QuantaDebuggerDBGp::propertySetResponse( const QDomNode & setnode)
+void QuantaDebuggerDBGp::propertySetResponse( const TQDomNode & setnode)
{
if(attribute(setnode, "success") == "0")
{
@@ -928,7 +928,7 @@ void QuantaDebuggerDBGp::propertySetResponse( const QDomNode & setnode)
}
-DebuggerVariable* QuantaDebuggerDBGp::buildVariable( const QDomNode & variablenode)
+DebuggerVariable* QuantaDebuggerDBGp::buildVariable( const TQDomNode & variablenode)
{
/*
Sample:
@@ -946,44 +946,44 @@ DebuggerVariable* QuantaDebuggerDBGp::buildVariable( const QDomNode & variableno
</property>
</property>
*/
- QString name = attribute(variablenode, "name");
- QString type = m_variabletypes[attribute(variablenode, "type")];
+ TQString name = attribute(variablenode, "name");
+ TQString type = m_variabletypes[attribute(variablenode, "type")];
if(type == "int")
{
- QString value = variablenode.firstChild().nodeValue();
+ TQString value = variablenode.firstChild().nodeValue();
return debuggerInterface()->newDebuggerVariable( name, value, DebuggerVariableTypes::Integer);
}
else if (type == "string")
{
- QCString value = QCString(variablenode.firstChild().nodeValue());
+ TQCString value = TQCString(variablenode.firstChild().nodeValue());
value = KCodecs::base64Decode(value);
return debuggerInterface()->newDebuggerVariable( name, value, DebuggerVariableTypes::String);
}
else if (type == "bool")
{
- QString value = variablenode.firstChild().nodeValue();
+ TQString value = variablenode.firstChild().nodeValue();
return debuggerInterface()->newDebuggerVariable( name, value, DebuggerVariableTypes::Boolean);
}
else if (type == "resource")
{
- QString value = variablenode.firstChild().nodeValue();
+ TQString value = variablenode.firstChild().nodeValue();
return debuggerInterface()->newDebuggerVariable( name, value, DebuggerVariableTypes::Resource);
}
else if (type == "float")
{
- QString value = variablenode.firstChild().nodeValue();
+ TQString value = variablenode.firstChild().nodeValue();
return debuggerInterface()->newDebuggerVariable( name, value, DebuggerVariableTypes::Float);
}
else if (type == "null")
{
- QString value = variablenode.firstChild().nodeValue();
+ TQString value = variablenode.firstChild().nodeValue();
return debuggerInterface()->newDebuggerVariable( name, "", DebuggerVariableTypes::Undefined);
}
else if (type == "hash" || type == "array" || type == "object")
{
- QDomNode child = variablenode.firstChild();
- QPtrList<DebuggerVariable> vars ;
+ TQDomNode child = variablenode.firstChild();
+ TQPtrList<DebuggerVariable> vars ;
while(!child.isNull())
{
DebuggerVariable* var = buildVariable( child);
@@ -1001,12 +1001,12 @@ DebuggerVariable* QuantaDebuggerDBGp::buildVariable( const QDomNode & variableno
return debuggerInterface()->newDebuggerVariable(name, "", DebuggerVariableTypes::Error);;
}
-void QuantaDebuggerDBGp::handleError(const QDomNode & statusnode )
+void QuantaDebuggerDBGp::handleError(const TQDomNode & statusnode )
{
if(attribute(statusnode, "reason") == "error" || attribute(statusnode, "reason") == "aborted")
{
- QDomNode errornode = statusnode.firstChild();
+ TQDomNode errornode = statusnode.firstChild();
while(!errornode.isNull())
{
if(errornode.nodeName() == "error")