summaryrefslogtreecommitdiff
path: root/client/netcom.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/netcom.cc')
-rw-r--r--client/netcom.cc29
1 files changed, 19 insertions, 10 deletions
diff --git a/client/netcom.cc b/client/netcom.cc
index 9c755b5..e0c7541 100644
--- a/client/netcom.cc
+++ b/client/netcom.cc
@@ -26,18 +26,19 @@
*/
#include "netcom.h"
+#include "debug.h"
+
#include <QtNetwork>
#include <QApplication>
#include <QByteArray>
-#include <QHttp>
+//#include <QHttp>
#include <QWidget>
#include "widgets/widget.h"
-#include "debug.h"
#ifdef USE_SSL
#include <QMessageBox>
@@ -119,18 +120,21 @@ void NetCom::makeTransfer(QByteArray body, session_state_t state, QString uri)
url.setPort(request.url().port());
url.setScheme(request.url().scheme());
+#ifdef QT5
+ QUrlQuery query;
+#else
+ QUrl &query = url;
+#endif
+
switch(state) {
case ::commit:
- // request.setRawHeader("SessionCommit", "yes");
- url.addQueryItem("statechange", "commit");
+ query.addQueryItem("statechange", "commit");
break;
case ::discard:
- // request.setRawHeader("SessionDiscard", "yes");
- url.addQueryItem("statechange", "discard");
+ query.addQueryItem("statechange", "discard");
break;
case ::nocommit:
- // request.setRawHeader("SessionNoCommit", "yes");
- url.addQueryItem("statechange", "nocommit");
+ query.addQueryItem("statechange", "nocommit");
break;
default:
case ::none:
@@ -138,8 +142,13 @@ void NetCom::makeTransfer(QByteArray body, session_state_t state, QString uri)
}
url.setPath(uri);
- if(sessionid != "") url.addQueryItem("sessionid", sessionid);
- if(patientid != "") url.addQueryItem("patientid", patientid);
+ if(sessionid != "") query.addQueryItem("sessionid", sessionid);
+ if(patientid != "") query.addQueryItem("patientid", patientid);
+
+#ifdef QT5
+ url.setQuery(query);
+#endif
+
request.setUrl(url);
manager->post(request, body);