aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/requestdata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jobs/requestdata.cpp')
-rw-r--r--lib/jobs/requestdata.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/jobs/requestdata.cpp b/lib/jobs/requestdata.cpp
index cec15954..ab249f6d 100644
--- a/lib/jobs/requestdata.cpp
+++ b/lib/jobs/requestdata.cpp
@@ -1,5 +1,9 @@
+// SPDX-FileCopyrightText: 2018 Kitsune Ral <kitsune-ral@users.sf.net>
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
#include "requestdata.h"
+#include <QtCore/QIODevice>
#include <QtCore/QBuffer>
#include <QtCore/QByteArray>
#include <QtCore/QJsonArray>
@@ -10,7 +14,7 @@ using namespace Quotient;
auto fromData(const QByteArray& data)
{
- auto source = std::make_unique<QBuffer>();
+ auto source = makeImpl<QBuffer, QIODevice>();
source->setData(data);
source->open(QIODevice::ReadOnly);
return source;
@@ -28,4 +32,6 @@ RequestData::RequestData(const QJsonObject& jo) : _source(fromJson(jo)) {}
RequestData::RequestData(const QJsonArray& ja) : _source(fromJson(ja)) {}
-RequestData::~RequestData() = default;
+RequestData::RequestData(QIODevice* source)
+ : _source(acquireImpl(source))
+{}