From 9201417e9973f901a39195507cf2935a529e821e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Jul 2015 14:42:33 +0200 Subject: fix msvc empty config list Some MSVC 2015RC bug with static initialized const char*. But reproduced also in #179 (?) --- opentrack/options.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'opentrack/options.hpp') diff --git a/opentrack/options.hpp b/opentrack/options.hpp index 7c3f6847..a10ba382 100644 --- a/opentrack/options.hpp +++ b/opentrack/options.hpp @@ -38,6 +38,10 @@ #include template using mem = std::shared_ptr; +#define OPENTRACK_CONFIG_FILENAME_KEY "settings-file" +#define OPENTRACK_DEFAULT_CONFIG_PATH "/settings/default.ini" +#define OPENTRACK_ORG "opentrack-2.3" + namespace options { template using map = std::map; @@ -97,7 +101,6 @@ namespace options { } conf.endGroup(); } - static constexpr const char* org = "opentrack-2.3"; void save() { @@ -129,13 +132,10 @@ namespace options { return kvs.count(s) != 0; } - static constexpr const char* filename_key = "settings-file"; - static constexpr const char* default_path = "/settings/default.ini"; - static const QString ini_pathname() { - QSettings settings(group::org); - return settings.value(filename_key, QCoreApplication::applicationDirPath() + default_path).toString(); + QSettings settings(OPENTRACK_ORG); + return settings.value(OPENTRACK_CONFIG_FILENAME_KEY, QCoreApplication::applicationDirPath() + OPENTRACK_DEFAULT_CONFIG_PATH).toString(); } static const QStringList ini_list() -- cgit v1.2.3