aboutsummaryrefslogtreecommitdiff
path: root/lib/converters.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-11-08 18:53:37 +0100
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-11-08 18:53:37 +0100
commit7355e2f801eb85e771a6c454c77f9eb62398f38b (patch)
tree788d127f093c5b9222cc3c40a5f15abf114dc328 /lib/converters.h
parent21fd088d207ee2c2724c5b250875a843b618497d (diff)
downloadlibquotient-7355e2f801eb85e771a6c454c77f9eb62398f38b.tar.gz
libquotient-7355e2f801eb85e771a6c454c77f9eb62398f38b.zip
converters.h: add QUrl support
Diffstat (limited to 'lib/converters.h')
-rw-r--r--lib/converters.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/converters.h b/lib/converters.h
index 543e9496..81d7b6d8 100644
--- a/lib/converters.h
+++ b/lib/converters.h
@@ -166,6 +166,14 @@ struct JsonConverter<QDate> {
};
template <>
+struct JsonConverter<QUrl> : JsonConverter<QString> {
+ static auto dump(const QUrl& url) // Override on top of that for QString
+ {
+ return JsonConverter<QString>::dump(url.toString(QUrl::FullyEncoded));
+ }
+};
+
+template <>
struct JsonConverter<QJsonArray> : public TrivialJsonDumper<QJsonArray> {
static auto load(const QJsonValue& jv) { return jv.toArray(); }
};