diff options
Diffstat (limited to 'client/netcom.cc')
-rw-r--r-- | client/netcom.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/client/netcom.cc b/client/netcom.cc index f569a6f..9056ec3 100644 --- a/client/netcom.cc +++ b/client/netcom.cc @@ -33,6 +33,8 @@ #include <QHttp> +#include <QWidget> + #include "widgets/widget.h" #ifdef USE_SSL @@ -46,6 +48,9 @@ #endif #endif +//#define DEBUG(fmt...) printf(fmt) +#define DEBUG(ftm...) + NetCom::NetCom(QString host, quint16 port) { // @@ -80,7 +85,7 @@ void NetCom::replyFinished(QNetworkReply *reply) QDomDocument NetCom::makeTransfer(QDomDocument &doc, bool commit, bool lockgui, bool discard) { - printf("\nMaking transfer:\n%s", doc.toString().toStdString().c_str()); + DEBUG("\nMaking transfer:\n%s", doc.toString().toStdString().c_str()); if(lockgui && qApp->activeWindow()) qApp->activeWindow()->setEnabled(false); if(lockgui) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); @@ -107,13 +112,13 @@ QDomDocument NetCom::makeTransfer(QDomDocument &doc, QDomDocument res_doc; res_doc.setContent(data); - printf("\nRecieved reponse:\n%s", data.data()); + DEBUG("\nRecieved reponse:\n%s", data.data()); - printf("\nRecieved reponse (Parsed):\n%s", res_doc.toByteArray().data()); + DEBUG("\nRecieved reponse (Parsed):\n%s", res_doc.toByteArray().data()); if(reply->hasRawHeader("SessionID")) { sessionid = reply->rawHeader("SessionID"); - printf("SESSION ID: %s\n", sessionid.toStdString().c_str()); + DEBUG("SESSION ID: %s\n", sessionid.toStdString().c_str()); } if(lockgui) QApplication::restoreOverrideCursor(); @@ -189,10 +194,10 @@ QDomDocument NetCom::send(QVector< Widget* > widgets, QString templ, while (i != widgets.end()) { Widget* w = *i; - if(!w->isDisabled() && w->name() != "") { + if(w->enabled() && w->name() != "" && w->local() == false) { QDomElement field_elem = doc.createElement("field"); field_elem.setAttribute("name", w->name()); - field_elem.setAttribute("value", w->getValue()); + field_elem.setAttribute("value", w->value()); commit_elem.appendChild(field_elem); } |