From 5c102fdd1e6825a77bb9d7a69e268868d7f5398e Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 19 Aug 2008 09:28:09 +0000 Subject: Bugfix. Shared connection didn't work with the continue action. --- client/macrowindow.cc | 12 +++++++++--- client/netcom.cc | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/client/macrowindow.cc b/client/macrowindow.cc index e3d4846..abd615c 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -128,8 +128,6 @@ bool MacroWindow::doCommit() // If all entries passed validation, continue commit if(faulty == 0) { - printf("MacroWindow -> committing...\n"); - Global::netcom->send(widgets, macro, version); return true; @@ -182,7 +180,15 @@ void MacroWindow::cont(QString name) i++; } if(doCommit()) { - new_macro("FIXME", macro); + + // FIXME: Hack to prevent XML clotching. + // The server could not differentiate the commit and the request. + delete Global::netcom; + Global::netcom = new NetCom(host, port, user, cpr); + + + // TODO: Where to get the course var?? + new_macro("example", macro); close(); } else { QMessageBox::critical(NULL, "Fejl", diff --git a/client/netcom.cc b/client/netcom.cc index 0f73e60..060517d 100644 --- a/client/netcom.cc +++ b/client/netcom.cc @@ -58,7 +58,10 @@ QDomDocument NetCom::send(QString course, QString macro) request_elem.setAttribute("macro", macro); pracro_elem.appendChild(request_elem); + printf(doc.toString().toStdString().c_str()); + socket.write(doc.toByteArray()); + socket.waitForBytesWritten(10000); do { qApp->processEvents(); -- cgit v1.2.3