summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-03 14:42:33 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-03 14:42:33 +0200
commit9201417e9973f901a39195507cf2935a529e821e (patch)
tree8cb23efc9ec1b62cb403d738ee6d47584a142cd0 /opentrack
parent6aa89934e8f22a580dc8a63cec61fb9ea9d14f23 (diff)
fix msvc empty config list
Some MSVC 2015RC bug with static initialized const char*. But reproduced also in #179 (?)
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/options.hpp12
1 files changed, 6 insertions, 6 deletions
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 <memory>
template<typename t> using mem = std::shared_ptr<t>;
+#define OPENTRACK_CONFIG_FILENAME_KEY "settings-file"
+#define OPENTRACK_DEFAULT_CONFIG_PATH "/settings/default.ini"
+#define OPENTRACK_ORG "opentrack-2.3"
+
namespace options {
template<typename k, typename v>
using map = std::map<k, v>;
@@ -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()