diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-07-15 13:07:53 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-15 13:07:53 +0900 |
commit | 3dfb74af71fe0cceaeb14d1ef0ade846f3a659f9 (patch) | |
tree | 40482bd167f1e086541ad71cdf634324b40383c6 /jobs/basejob.h | |
parent | 47c2015beb75693c7181fb7359a4aa166e926fe7 (diff) | |
parent | 749def2b983d2338272c0891d15de20df22e2eea (diff) | |
download | libquotient-3dfb74af71fe0cceaeb14d1ef0ade846f3a659f9.tar.gz libquotient-3dfb74af71fe0cceaeb14d1ef0ade846f3a659f9.zip |
Merge pull request #72 from QMatrixClient/kitsune-send-events
Events creation and sending
Diffstat (limited to 'jobs/basejob.h')
-rw-r--r-- | jobs/basejob.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/jobs/basejob.h b/jobs/basejob.h index 2be4577f..0ec40a7a 100644 --- a/jobs/basejob.h +++ b/jobs/basejob.h @@ -63,7 +63,7 @@ namespace QMatrixClient public: using QUrlQuery::QUrlQuery; Query() = default; - explicit Query(const QList< QPair<QString, QString> >& l) + explicit Query(const std::initializer_list< QPair<QString, QString> >& l) { setQueryItems(l); } @@ -78,11 +78,16 @@ namespace QMatrixClient { public: Data() = default; - explicit Data(const QList< QPair<QString, QString> >& l) + Data(const QJsonObject& o) : QJsonObject(o) { } + Data(QJsonObject&& o) : QJsonObject(std::move(o)) { } +#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0)) + // This method exists in QJsonObject of newer Qt versions + explicit Data(const std::initializer_list< QPair<QString, QString> >& l) { for (auto i: l) insert(i.first, i.second); } +#endif QByteArray serialize() const { return QJsonDocument(*this).toJson(); |