aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/filter.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-02 17:58:34 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-04 20:13:43 +0900
commit3dd6b5e6cc50aafce74b21b5a0bf4b26a9fcf6ee (patch)
treea647fa5328e04b20a84e46d29d420555d9c56cde /lib/csapi/filter.cpp
parented467d27b07781fdd2f7ddef043568954ce50b69 (diff)
downloadlibquotient-3dd6b5e6cc50aafce74b21b5a0bf4b26a9fcf6ee.tar.gz
libquotient-3dd6b5e6cc50aafce74b21b5a0bf4b26a9fcf6ee.zip
Use QStringLiteral() and operator"" _ls() in network jobs
Diffstat (limited to 'lib/csapi/filter.cpp')
-rw-r--r--lib/csapi/filter.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/csapi/filter.cpp b/lib/csapi/filter.cpp
index a1546923..51056cc3 100644
--- a/lib/csapi/filter.cpp
+++ b/lib/csapi/filter.cpp
@@ -18,8 +18,10 @@ class DefineFilterJob::Private
QString filterId;
};
+static const auto DefineFilterJobName = QStringLiteral("DefineFilterJob");
+
DefineFilterJob::DefineFilterJob(const QString& userId, const SyncFilter& filter)
- : BaseJob(HttpVerb::Post, "DefineFilterJob",
+ : BaseJob(HttpVerb::Post, DefineFilterJobName,
basePath % "/user/" % userId % "/filter")
, d(new Private)
{
@@ -36,7 +38,7 @@ const QString& DefineFilterJob::filterId() const
BaseJob::Status DefineFilterJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
- d->filterId = fromJson<QString>(json.value("filter_id"));
+ d->filterId = fromJson<QString>(json.value("filter_id"_ls));
return Success;
}
@@ -52,8 +54,10 @@ QUrl GetFilterJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QSt
basePath % "/user/" % userId % "/filter/" % filterId);
}
+static const auto GetFilterJobName = QStringLiteral("GetFilterJob");
+
GetFilterJob::GetFilterJob(const QString& userId, const QString& filterId)
- : BaseJob(HttpVerb::Get, "GetFilterJob",
+ : BaseJob(HttpVerb::Get, GetFilterJobName,
basePath % "/user/" % userId % "/filter/" % filterId)
, d(new Private)
{
@@ -69,10 +73,10 @@ const SyncFilter& GetFilterJob::data() const
BaseJob::Status GetFilterJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
- if (!json.contains("data"))
+ if (!json.contains("data"_ls))
return { JsonParseError,
"The key 'data' not found in the response" };
- d->data = fromJson<SyncFilter>(json.value("data"));
+ d->data = fromJson<SyncFilter>(json.value("data"_ls));
return Success;
}