From b7d4c997a3a39f4b4a57f82e714b3773261905ad Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 19 Dec 2014 16:56:17 +0100 Subject: [PATCH] Fix rebase of branch --- src/gui/sharedialog.cpp | 16 +++++++++++++--- src/gui/sharedialog.h | 2 +- src/gui/sharedialog.ui | 4 ++-- src/gui/socketapi.cpp | 2 +- src/gui/socketapi.h | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 47ca96fc7..f82c967f2 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -5,14 +5,13 @@ #include "json.h" #include "folderman.h" #include -#include #include namespace { int SHARETYPE_PUBLIC = 3; } -namespace Mirall { +namespace OCC { ShareDialog::ShareDialog(QWidget *parent) : QDialog(parent), @@ -278,7 +277,18 @@ void OcsShareJob::start() req.setRawHeader("Content-Type", "application/x-www-form-urlencoded"); qDebug() << ">>>>>>>>" << _url; QBuffer *buffer = new QBuffer; - buffer->setData(_postData.query().toAscii()); + //buffer->setData(_postData.query().toAscii()); + + QString tmp; + auto tmp2 = _postData.queryItems(); + for (int i = 0; i < tmp2.size(); i++) { + if (i != 0) { + tmp.append("="); + } + tmp.append(tmp2[i].first + "=" + tmp2[i].second); + } + buffer->setData(tmp.toAscii()); + setReply(davRequest(_verb, _url, req, buffer)); //setReply(davRequest("GET", url, req)); setupConnections(reply()); diff --git a/src/gui/sharedialog.h b/src/gui/sharedialog.h index 569f13ee4..af63bde33 100644 --- a/src/gui/sharedialog.h +++ b/src/gui/sharedialog.h @@ -4,7 +4,7 @@ #include "networkjobs.h" #include -namespace Mirall { +namespace OCC { class OcsShareJob : public AbstractNetworkJob { Q_OBJECT diff --git a/src/gui/sharedialog.ui b/src/gui/sharedialog.ui index 72ba5788e..515ef9616 100644 --- a/src/gui/sharedialog.ui +++ b/src/gui/sharedialog.ui @@ -1,7 +1,7 @@ - Mirall::ShareDialog - + OCC::ShareDialog + 0 diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index 9b73270a0..fac193c92 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -402,7 +402,7 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString& argument, SocketType sendMessage(socket, message); } -void SocketApi::command_SHARE(const QString& argument, QTcpSocket* socket) +void SocketApi::command_SHARE(const QString& argument, SocketType* socket) { sendMessage(socket, QString("Openening sharing dialog >").append(argument)); QString folderForPath = FolderMan::instance()->folderForPath(argument)->path(); diff --git a/src/gui/socketapi.h b/src/gui/socketapi.h index 308c7bdf1..ac6000ae2 100644 --- a/src/gui/socketapi.h +++ b/src/gui/socketapi.h @@ -78,7 +78,7 @@ private: Q_INVOKABLE void command_RETRIEVE_FOLDER_STATUS(const QString& argument, SocketType* socket); Q_INVOKABLE void command_RETRIEVE_FILE_STATUS(const QString& argument, SocketType* socket); - Q_INVOKABLE void command_SHARE(const QString& argument, QTcpSocket* socket); + Q_INVOKABLE void command_SHARE(const QString& argument, SocketType* socket); Q_INVOKABLE void command_VERSION(const QString& argument, SocketType* socket);