aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/room_state.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/room_state.cpp
parented467d27b07781fdd2f7ddef043568954ce50b69 (diff)
downloadlibquotient-3dd6b5e6cc50aafce74b21b5a0bf4b26a9fcf6ee.tar.gz
libquotient-3dd6b5e6cc50aafce74b21b5a0bf4b26a9fcf6ee.zip
Use QStringLiteral() and operator"" _ls() in network jobs
Diffstat (limited to 'lib/csapi/room_state.cpp')
-rw-r--r--lib/csapi/room_state.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp
index 39f36afb..8f87979d 100644
--- a/lib/csapi/room_state.cpp
+++ b/lib/csapi/room_state.cpp
@@ -18,8 +18,10 @@ class SetRoomStateWithKeyJob::Private
QString eventId;
};
+static const auto SetRoomStateWithKeyJobName = QStringLiteral("SetRoomStateWithKeyJob");
+
SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body)
- : BaseJob(HttpVerb::Put, "SetRoomStateWithKeyJob",
+ : BaseJob(HttpVerb::Put, SetRoomStateWithKeyJobName,
basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey)
, d(new Private)
{
@@ -36,7 +38,7 @@ const QString& SetRoomStateWithKeyJob::eventId() const
BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
- d->eventId = fromJson<QString>(json.value("event_id"));
+ d->eventId = fromJson<QString>(json.value("event_id"_ls));
return Success;
}
@@ -46,8 +48,10 @@ class SetRoomStateJob::Private
QString eventId;
};
+static const auto SetRoomStateJobName = QStringLiteral("SetRoomStateJob");
+
SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body)
- : BaseJob(HttpVerb::Put, "SetRoomStateJob",
+ : BaseJob(HttpVerb::Put, SetRoomStateJobName,
basePath % "/rooms/" % roomId % "/state/" % eventType)
, d(new Private)
{
@@ -64,7 +68,7 @@ const QString& SetRoomStateJob::eventId() const
BaseJob::Status SetRoomStateJob::parseJson(const QJsonDocument& data)
{
auto json = data.object();
- d->eventId = fromJson<QString>(json.value("event_id"));
+ d->eventId = fromJson<QString>(json.value("event_id"_ls));
return Success;
}