Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2016-03-04 19:37:54 +0300
committerKlaas Freitag <freitag@owncloud.com>2016-03-10 19:22:36 +0300
commiteb00b341915de2cb69b1f849dd3847e2031b2c16 (patch)
tree29397ed8dff589e9b01064a80df0afae71558f08 /src/gui/notificationconfirmjob.cpp
parenta831b7417f4f9dba5308c164cb6081346f4e0bbc (diff)
Minor wording fixes
Diffstat (limited to 'src/gui/notificationconfirmjob.cpp')
-rw-r--r--src/gui/notificationconfirmjob.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/gui/notificationconfirmjob.cpp b/src/gui/notificationconfirmjob.cpp
new file mode 100644
index 000000000..f243656fc
--- /dev/null
+++ b/src/gui/notificationconfirmjob.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) by Klaas Freitag <freitag@owncloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "notificationconfirmjob.h"
+#include "networkjobs.h"
+#include "account.h"
+#include "json.h"
+
+#include <QBuffer>
+
+namespace OCC {
+
+NotificationConfirmJob::NotificationConfirmJob(AccountPtr account)
+: AbstractNetworkJob(account, "")
+{
+ setIgnoreCredentialFailure(true);
+}
+
+void NotificationConfirmJob::setLinkAndVerb(const QUrl& link, const QString &verb)
+{
+ _link = link;
+ _verb = verb;
+}
+
+void NotificationConfirmJob::start()
+{
+ if( !_link.isValid() ) {
+ qDebug() << "Attempt to trigger invalid URL: " << _link.toString();
+ return;
+ }
+ QNetworkRequest req;
+ req.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
+
+ QIODevice *iodevice = 0;
+ setReply(davRequest(_verb.toAscii(), _link, req, iodevice));
+ setupConnections(reply());
+
+ AbstractNetworkJob::start();
+}
+
+bool NotificationConfirmJob::finished()
+{
+ int replyCode = 0;
+ // FIXME: check for the reply code!
+ const QString replyData = reply()->readAll();
+
+ emit jobFinished(replyData, replyCode);
+
+ return true;
+
+}
+
+}