summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--facetracknoir/ui.cpp12
-rw-r--r--opentrack/mappings.hpp8
-rw-r--r--opentrack/options.hpp2
3 files changed, 13 insertions, 9 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index 66e7c80f..466261fa 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -31,6 +31,8 @@
# include <windows.h>
#endif
+static constexpr const char* _group = "opentrack-2.3";
+
MainWindow::MainWindow() :
pose_update_timer(this),
kbd_quit(QKeySequence("Ctrl+Q"), this),
@@ -106,7 +108,7 @@ void MainWindow::open() {
if (! fileName.isEmpty() ) {
{
- QSettings settings("opentrack");
+ QSettings settings(_group);
settings.setValue ("SettingsFile", QFileInfo(fileName).absoluteFilePath());
}
fill_profile_combobox();
@@ -127,7 +129,7 @@ void MainWindow::save() {
save_mappings();
#if defined(__unix) || defined(__linux)
- QSettings settings("opentrack");
+ QSettings settings(_group);
const QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
QByteArray bytes = QFile::encodeName(currentFile);
const char* filename_as_asciiz = bytes.constData();
@@ -141,7 +143,7 @@ void MainWindow::save() {
void MainWindow::saveAs()
{
- QSettings settings("opentrack");
+ QSettings settings(_group);
QString oldFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"),
@@ -181,7 +183,7 @@ extern "C" volatile const char* opentrack_version;
void MainWindow::fill_profile_combobox()
{
- QSettings settings("opentrack");
+ QSettings settings(_group);
QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath()
+ "/settings/default.ini" ).toString();
qDebug() << "Config file now" << currentFile;
@@ -392,7 +394,7 @@ void MainWindow::exit() {
void MainWindow::profileSelected(int index)
{
- QSettings settings("opentrack");
+ QSettings settings(_group);
QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
QFileInfo pathInfo ( currentFile );
settings.setValue ("SettingsFile", pathInfo.absolutePath() + "/" + ui.iconcomboProfile->itemText(index));
diff --git a/opentrack/mappings.hpp b/opentrack/mappings.hpp
index 86126db9..7f949f2d 100644
--- a/opentrack/mappings.hpp
+++ b/opentrack/mappings.hpp
@@ -6,6 +6,8 @@ using namespace options;
#include "../qfunctionconfigurator/functionconfig.h"
#include "main-settings.hpp"
+static constexpr const char* settings_group = "opentrack-2.3";
+
class Mapping {
public:
Mapping(QString primary,
@@ -22,7 +24,7 @@ public:
name2(secondary)
{
// XXX TODO move all this qsettings boilerplate into a single header -sh 20141004
- QSettings settings("opentrack");
+ QSettings settings(settings_group);
QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
QSettings iniFile(currentFile, QSettings::IniFormat);
curve.loadSettings(iniFile, primary);
@@ -54,7 +56,7 @@ public:
void load_mappings()
{
- QSettings settings("opentrack");
+ QSettings settings(settings_group);
QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
QSettings iniFile( currentFile, QSettings::IniFormat );
@@ -66,7 +68,7 @@ public:
}
void save_mappings()
{
- QSettings settings("opentrack");
+ QSettings settings(settings_group);
QString currentFile = settings.value("SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini").toString();
QSettings iniFile(currentFile, QSettings::IniFormat);
diff --git a/opentrack/options.hpp b/opentrack/options.hpp
index 6c15d729..1d54e8b3 100644
--- a/opentrack/options.hpp
+++ b/opentrack/options.hpp
@@ -97,7 +97,7 @@ namespace options {
}
conf.endGroup();
}
- static constexpr const char* org = "opentrack";
+ static constexpr const char* org = "opentrack-2.3";
void save()
{