aboutsummaryrefslogtreecommitdiff
path: root/lib/application-service/definitions/location.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/application-service/definitions/location.cpp')
-rw-r--r--lib/application-service/definitions/location.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/application-service/definitions/location.cpp b/lib/application-service/definitions/location.cpp
index 958a55bf..a53db8d7 100644
--- a/lib/application-service/definitions/location.cpp
+++ b/lib/application-service/definitions/location.cpp
@@ -6,25 +6,19 @@
using namespace QMatrixClient;
-QJsonObject QMatrixClient::toJson(const ThirdPartyLocation& pod)
+void JsonObjectConverter<ThirdPartyLocation>::dumpTo(
+ QJsonObject& jo, const ThirdPartyLocation& pod)
{
- QJsonObject jo;
addParam<>(jo, QStringLiteral("alias"), pod.alias);
addParam<>(jo, QStringLiteral("protocol"), pod.protocol);
addParam<>(jo, QStringLiteral("fields"), pod.fields);
- return jo;
}
-ThirdPartyLocation FromJsonObject<ThirdPartyLocation>::operator()(const QJsonObject& jo) const
+void JsonObjectConverter<ThirdPartyLocation>::fillFrom(
+ const QJsonObject& jo, ThirdPartyLocation& result)
{
- ThirdPartyLocation result;
- result.alias =
- fromJson<QString>(jo.value("alias"_ls));
- result.protocol =
- fromJson<QString>(jo.value("protocol"_ls));
- result.fields =
- fromJson<QJsonObject>(jo.value("fields"_ls));
-
- return result;
+ fromJson(jo.value("alias"_ls), result.alias);
+ fromJson(jo.value("protocol"_ls), result.protocol);
+ fromJson(jo.value("fields"_ls), result.fields);
}