diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-09-02 15:15:19 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-09-02 15:15:19 +0900 |
commit | 62ad12b69b3b085a32c9522194b7b141d2346361 (patch) | |
tree | 127b301688351104dfc5af3a009486e374e99ae3 /lib/converters.h | |
parent | 3d446f3ff6effb87da2e2a9df0e2c7ba9073e154 (diff) | |
download | libquotient-62ad12b69b3b085a32c9522194b7b141d2346361.tar.gz libquotient-62ad12b69b3b085a32c9522194b7b141d2346361.zip |
Switch tag order from strings to floats, as The Spec preaches
The Spec wasn't entirely consistent on this until recently but floats actually are used in the wild, rather than strings.
Diffstat (limited to 'lib/converters.h')
-rw-r--r-- | lib/converters.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/converters.h b/lib/converters.h index 1e828393..7f78effe 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -163,6 +163,11 @@ namespace QMatrixClient auto operator()(const QJsonValue& jv) const { return jv.toDouble(); } }; + template <> struct FromJson<float> + { + auto operator()(const QJsonValue& jv) const { return float(jv.toDouble()); } + }; + template <> struct FromJson<qint64> { auto operator()(const QJsonValue& jv) const { return qint64(jv.toDouble()); } |