diff options
Diffstat (limited to 'client/netcom.cc')
-rw-r--r-- | client/netcom.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/client/netcom.cc b/client/netcom.cc index 02c5704..d04493f 100644 --- a/client/netcom.cc +++ b/client/netcom.cc @@ -37,6 +37,8 @@ #include "widgets/widget.h" +#include "debug.h" + #ifdef USE_SSL #include <QMessageBox> #include <QList> @@ -48,9 +50,6 @@ #endif #endif -//#define DEBUG(fmt...) printf(fmt) -#define DEBUG(ftm...) - NetCom::NetCom(QString host, quint16 port) { // @@ -85,7 +84,7 @@ void NetCom::replyFinished(QNetworkReply *reply) QDomDocument NetCom::makeTransfer(QDomDocument &doc, bool commit, bool lockgui, bool discard) { - DEBUG("\nMaking transfer:\n%s", doc.toString().toStdString().c_str()); + DEBUG(netcom, "Making transfer:\n%s", doc.toString().toStdString().c_str()); if(lockgui && qApp->activeWindow()) qApp->activeWindow()->setEnabled(false); if(lockgui) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -112,13 +111,13 @@ QDomDocument NetCom::makeTransfer(QDomDocument &doc, QDomDocument res_doc; res_doc.setContent(data); - DEBUG("\nRecieved reponse:\n%s", data.data()); + DEBUG(netcom, "Recieved reponse:\n%s", data.data()); - DEBUG("\nRecieved reponse (Parsed):\n%s", res_doc.toByteArray().data()); + DEBUG(netcom, "Recieved reponse (Parsed):\n%s", res_doc.toByteArray().data()); if(reply->hasRawHeader("SessionID")) { sessionid = reply->rawHeader("SessionID"); - DEBUG("SESSION ID: %s\n", sessionid.toStdString().c_str()); + LOG(netcom, "SESSION ID: %s\n", sessionid.toStdString().c_str()); } if(lockgui) QApplication::restoreOverrideCursor(); @@ -192,10 +191,10 @@ QDomDocument NetCom::send(QVector< Widget* > widgets, QString templ, // the commit string QVector< Widget* >::iterator i = widgets.begin(); while(i != widgets.end()) { - DEBUG("W = "); + DEBUG(netcom, "W = "); if(*i) { Widget* w = *i; - DEBUG("name: %s val: %s", w->name().toStdString().c_str(), + DEBUG(netcom, "name: %s val: %s", w->name().toStdString().c_str(), w->value().toStdString().c_str()); if(w->enabled() && w->name() != "" && w->local() == false) { QDomElement field_elem = doc.createElement("field"); @@ -204,7 +203,6 @@ QDomDocument NetCom::send(QVector< Widget* > widgets, QString templ, commit_elem.appendChild(field_elem); } } - DEBUG("\n"); i++; } |