summaryrefslogtreecommitdiffhomepage
path: root/options
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-04-28 17:26:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-04-28 21:27:35 +0200
commit0c27d726a900b901e8bffafe993a3d3e36bf27f3 (patch)
tree960bcda73075a62826300d7805f6db1b303ac540 /options
parentc80dd2e156e20f028cf4631fd7874a89c3568bab (diff)
random cleanups
Diffstat (limited to 'options')
-rw-r--r--options/defs.hpp1
-rw-r--r--options/value-traits.hpp6
-rw-r--r--options/value.hpp8
3 files changed, 7 insertions, 8 deletions
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<t>;
+ using stored_type = std::decay_t<t>;
using value_type = std::decay_t<u>;
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<value_type>(x); }
- static inline element_type to_storage(const value_type& val) { return static_cast<element_type>(val); }
+ static inline value_type from_storage(const stored_type& x) { return static_cast<value_type>(x); }
+ static inline stored_type to_storage(const value_type& val) { return static_cast<stored_type>(val); }
};
template<typename t, typename u = t, typename Enable = void>
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<typename t>
class value final : public base_value
{
using traits = detail::value_traits<t, t, void>;
- 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<element_type>() == val2.value<element_type>();
+ return val1.value<stored_type>() == val2.value<stored_type>();
}
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<element_type>());
+ const stored_type x(variant.value<stored_type>());
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())