summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-11-02 06:07:11 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-11-02 06:24:28 +0100
commitab72c34a668d604942b27f912f8a1971870782fe (patch)
tree93a4ea940e28daad9c900181f60f8a45c64bfb1e /facetracknoir
parentc044ce0d0830902b9ca86dcd9a725e5ef4f72eb1 (diff)
separate config directory for 2.3-branch
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/ui.cpp12
1 files changed, 7 insertions, 5 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));