From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/pusher.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'lib/csapi/pusher.cpp') diff --git a/lib/csapi/pusher.cpp b/lib/csapi/pusher.cpp index 664959f4..86b36c6d 100644 --- a/lib/csapi/pusher.cpp +++ b/lib/csapi/pusher.cpp @@ -12,28 +12,28 @@ using namespace QMatrixClient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); -namespace QMatrixClient -{ +namespace QMatrixClient { // Converters - template <> struct JsonObjectConverter - { - static void fillFrom(const QJsonObject& jo, GetPushersJob::PusherData& result) + template <> struct JsonObjectConverter { + static void fillFrom(const QJsonObject& jo, + GetPushersJob::PusherData& result) { fromJson(jo.value("url"_ls), result.url); fromJson(jo.value("format"_ls), result.format); } }; - template <> struct JsonObjectConverter - { - static void fillFrom(const QJsonObject& jo, GetPushersJob::Pusher& result) + template <> struct JsonObjectConverter { + static void fillFrom(const QJsonObject& jo, + GetPushersJob::Pusher& result) { fromJson(jo.value("pushkey"_ls), result.pushkey); fromJson(jo.value("kind"_ls), result.kind); fromJson(jo.value("app_id"_ls), result.appId); fromJson(jo.value("app_display_name"_ls), result.appDisplayName); - fromJson(jo.value("device_display_name"_ls), result.deviceDisplayName); + fromJson(jo.value("device_display_name"_ls), + result.deviceDisplayName); fromJson(jo.value("profile_tag"_ls), result.profileTag); fromJson(jo.value("lang"_ls), result.lang); fromJson(jo.value("data"_ls), result.data); @@ -44,21 +44,19 @@ namespace QMatrixClient class GetPushersJob::Private { public: - QVector pushers; + QVector pushers; }; QUrl GetPushersJob::makeRequestUrl(QUrl baseUrl) { - return BaseJob::makeRequestUrl(std::move(baseUrl), - basePath % "/pushers"); + return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/pushers"); } static const auto GetPushersJobName = QStringLiteral("GetPushersJob"); GetPushersJob::GetPushersJob() - : BaseJob(HttpVerb::Get, GetPushersJobName, - basePath % "/pushers") - , d(new Private) + : BaseJob(HttpVerb::Get, GetPushersJobName, basePath % "/pushers"), + d(new Private) { } @@ -76,13 +74,12 @@ BaseJob::Status GetPushersJob::parseJson(const QJsonDocument& data) return Success; } -namespace QMatrixClient -{ +namespace QMatrixClient { // Converters - template <> struct JsonObjectConverter - { - static void dumpTo(QJsonObject& jo, const PostPusherJob::PusherData& pod) + template <> struct JsonObjectConverter { + static void dumpTo(QJsonObject& jo, + const PostPusherJob::PusherData& pod) { addParam(jo, QStringLiteral("url"), pod.url); addParam(jo, QStringLiteral("format"), pod.format); @@ -92,9 +89,13 @@ namespace QMatrixClient static const auto PostPusherJobName = QStringLiteral("PostPusherJob"); -PostPusherJob::PostPusherJob(const QString& pushkey, const QString& kind, const QString& appId, const QString& appDisplayName, const QString& deviceDisplayName, const QString& lang, const PusherData& data, const QString& profileTag, Omittable append) - : BaseJob(HttpVerb::Post, PostPusherJobName, - basePath % "/pushers/set") +PostPusherJob::PostPusherJob(const QString& pushkey, const QString& kind, + const QString& appId, + const QString& appDisplayName, + const QString& deviceDisplayName, + const QString& lang, const PusherData& data, + const QString& profileTag, Omittable append) + : BaseJob(HttpVerb::Post, PostPusherJobName, basePath % "/pushers/set") { QJsonObject _data; addParam<>(_data, QStringLiteral("pushkey"), pushkey); @@ -108,4 +109,3 @@ PostPusherJob::PostPusherJob(const QString& pushkey, const QString& kind, const addParam(_data, QStringLiteral("append"), append); setRequestData(_data); } - -- cgit v1.2.3