diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-07-21 11:31:06 +0200 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-07-21 11:31:06 +0200 |
commit | c94dc1104e1eb5e0537fcd9429626988524c8a98 (patch) | |
tree | 7737c6f74985b254f7320a170ef14cda447e9f11 /lib/converters.h | |
parent | 8da4918aa10340ef52177977a8bcad489419f8e2 (diff) | |
download | libquotient-c94dc1104e1eb5e0537fcd9429626988524c8a98.tar.gz libquotient-c94dc1104e1eb5e0537fcd9429626988524c8a98.zip |
converters.*: clean away old cruft
Diffstat (limited to 'lib/converters.h')
-rw-r--r-- | lib/converters.h | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/lib/converters.h b/lib/converters.h index 075af7ef..543e9496 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -30,21 +30,6 @@ #include <vector> -#if QT_VERSION < QT_VERSION_CHECK(5,14,0) -// Enable std::unordered_map<QString, T> -// REMOVEME in favor of UnorderedMap, once we regenerate API files -namespace std { -template <> -struct hash<QString> { - size_t operator()(const QString& s) const Q_DECL_NOEXCEPT - { - return qHash(s, uint(qGlobalQHashSeed()) - ); - } -}; -} // namespace std -#endif - class QVariant; namespace Quotient { @@ -296,18 +281,9 @@ template <typename T> struct JsonObjectConverter<QHash<QString, T>> : public HashMapFromJson<QHash<QString, T>> {}; -// We could use std::conditional<> below but QT_VERSION* macros in C++ code -// cause (kinda valid but useless and noisy) compiler warnings about -// bitwise operations on signed integers; so use the preprocessor for now. -using variant_map_t = -#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) - QVariantHash; -#else - QVariantMap; -#endif template <> -struct JsonConverter<variant_map_t> { - static QJsonObject dump(const variant_map_t& vh); +struct JsonConverter<QVariantHash> { + static QJsonObject dump(const QVariantHash& vh); static QVariantHash load(const QJsonValue& jv); }; |