diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-11-04 19:12:05 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-11-04 19:20:15 +0100 |
commit | 4c71c6cf336b4891fede0e300f4ab20a5d0a19b4 (patch) | |
tree | 01487f975d30fbd91bd2367e942627d5e915386b /facetracknoir | |
parent | 790307a1ea1bad21d128872a53181a0b3e5ad3bd (diff) |
explicitly delimit QSettings scope
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/ui.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 0a11de42..e89fbc73 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -140,7 +140,6 @@ void MainWindow::save() { void MainWindow::saveAs() { QString oldFile = group::ini_pathname(); - QSettings settings(group::org); QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"), oldFile, tr("Settings file (*.ini);;All Files (*)")); @@ -158,7 +157,10 @@ void MainWindow::saveAs() oldFileFile.copy( fileName ); } - settings.setValue (group::filename_key, fileName); + { + QSettings settings(group::org); + settings.setValue (group::filename_key, fileName); + } save(); } @@ -391,10 +393,12 @@ void MainWindow::exit() { void MainWindow::profileSelected(int index) { - QSettings settings(group::org); QString currentFile = group::ini_pathname(); QFileInfo pathInfo ( currentFile ); - settings.setValue (group::filename_key, pathInfo.absolutePath() + "/" + ui.iconcomboProfile->itemText(index)); + { + QSettings settings(group::org); + settings.setValue (group::filename_key, pathInfo.absolutePath() + "/" + ui.iconcomboProfile->itemText(index)); + } load_settings(); } |