From 0c27d726a900b901e8bffafe993a3d3e36bf27f3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 28 Apr 2018 17:26:05 +0200 Subject: random cleanups --- options/defs.hpp | 1 - options/value-traits.hpp | 6 +++--- options/value.hpp | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'options') diff --git a/options/defs.hpp b/options/defs.hpp index feaad005..f14a1cbe 100644 --- a/options/defs.hpp +++ b/options/defs.hpp @@ -5,7 +5,6 @@ #define OPENTRACK_CONFIG_FILENAME_KEY "settings-filename" #define OPENTRACK_DEFAULT_CONFIG "default.ini" -#define OPENTRACK_DEFAULT_CONFIG_Q QStringLiteral("default.ini") #define OTR_OPTIONS_EXPAND2(x) x #define OTR_OPTIONS_EXPAND1(x) OTR_OPTIONS_EXPAND2(x) diff --git a/options/value-traits.hpp b/options/value-traits.hpp index 680f138c..8a04b46d 100644 --- a/options/value-traits.hpp +++ b/options/value-traits.hpp @@ -16,12 +16,12 @@ struct default_value_traits { virtual ~default_value_traits() = default; - using element_type = std::decay_t; + using stored_type = std::decay_t; using value_type = std::decay_t; static inline value_type from_value(const value_type& val, const value_type&) { return val; } - static inline value_type from_storage(const element_type& x) { return static_cast(x); } - static inline element_type to_storage(const value_type& val) { return static_cast(val); } + static inline value_type from_storage(const stored_type& x) { return static_cast(x); } + static inline stored_type to_storage(const value_type& val) { return static_cast(val); } }; template diff --git a/options/value.hpp b/options/value.hpp index c8fb02ca..2c2e9dd0 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -34,11 +34,11 @@ template class value final : public base_value { using traits = detail::value_traits; - using element_type = typename traits::element_type; + using stored_type = typename traits::stored_type; static bool is_equal(const QVariant& val1, const QVariant& val2) { - return val1.value() == val2.value(); + return val1.value() == val2.value(); } never_inline @@ -52,7 +52,7 @@ class value final : public base_value if (!b->contains(self_name) || variant.type() == QVariant::Invalid) return def; - const element_type x(variant.value()); + const stored_type x(variant.value()); return traits::from_value(traits::from_storage(x), def); } @@ -75,7 +75,7 @@ public: never_inline value(bundle b, const QString& name, t def) : - base_value(b, name, &is_equal, std::type_index(typeid(element_type))), + base_value(b, name, &is_equal, std::type_index(typeid(stored_type))), def(def) { if (!self_name.isEmpty()) -- cgit v1.2.3