summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_hatire
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-08-22 19:02:25 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-08-22 19:02:25 +0200
commit4ab33fdfbb23fdfed5327d402989fd53d79f5380 (patch)
treeeef1c2f20d1d9bfe7d44b3a7f4e1bcb2f568d4ec /ftnoir_tracker_hatire
parent05203f39e6314c09f65d69c028b9f9d864de3f7b (diff)
main, ui: store config files in a predefined directory
Settings files are now stored in Documents/opentrack-version. The transition path is to copy all .ini files into that directory, accessible through the "Profile" menu dropdown. Issue: #179
Diffstat (limited to 'ftnoir_tracker_hatire')
-rw-r--r--ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp
index 80543e7a..0a4454e4 100644
--- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp
+++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.cpp
@@ -35,15 +35,11 @@
void TrackerSettings::load_ini()
{
-#ifdef OPENTRACK_API
+#ifndef OPENTRACK_API
QSettings settings(OPENTRACK_ORG); // Registry settings (in HK_USER)
+ QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
#else
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
-#endif
-#ifdef OPENTRACK_API
- QString currentFile = settings.value( OPENTRACK_CONFIG_FILENAME_KEY, QCoreApplication::applicationDirPath() + OPENTRACK_DEFAULT_CONFIG_PATH ).toString();
-#else
- QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
+ QString currentFile = options::group::ini_pathname();
#endif
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
@@ -101,19 +97,14 @@ void TrackerSettings::load_ini()
iniFile.endGroup();
}
-
void TrackerSettings::save_ini() const
{
-#ifdef OPENTRACK_API
+#ifndef OPENTRACK_API
QSettings settings(OPENTRACK_ORG); // Registry settings (in HK_USER)
+ QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
#else
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
-#endif
-#ifdef OPENTRACK_API
- QString currentFile = settings.value( OPENTRACK_CONFIG_FILENAME_KEY, QCoreApplication::applicationDirPath() + OPENTRACK_DEFAULT_CONFIG_PATH ).toString();
-#else
- QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
+ QString currentFile = options::group::ini_pathname();
#endif
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)