From fd125240114e52d207cc412876410e3cb8f0e796 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sun, 18 Oct 2015 15:38:05 +0300 Subject: [PATCH] Fixed synchronization --HG-- branch : feature --- src/libs/vmisc/vcommonsettings.cpp | 3 +++ src/libs/vmisc/vsettings.cpp | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 97bc09826..0a1540184 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -83,6 +83,7 @@ void VCommonSettings::SetPathIndividualMeasurements(const QString &value) { QSettings settings(this->format(), this->scope(), this->organizationName()); settings.setValue(SettingPathsIndividualMeasurements, value); + settings.sync(); } //--------------------------------------------------------------------------------------------------------------------- @@ -97,6 +98,7 @@ void VCommonSettings::SetPathStandardMeasurements(const QString &value) { QSettings settings(this->format(), this->scope(), this->organizationName()); settings.setValue(SettingPathsStandardMeasurements, value); + settings.sync(); } @@ -112,6 +114,7 @@ void VCommonSettings::SetPathTemplate(const QString &value) { QSettings settings(this->format(), this->scope(), this->organizationName()); settings.setValue(SettingPathsTemplates, value); + settings.sync(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/vsettings.cpp b/src/libs/vmisc/vsettings.cpp index 04c76151f..d16c7342a 100644 --- a/src/libs/vmisc/vsettings.cpp +++ b/src/libs/vmisc/vsettings.cpp @@ -91,25 +91,31 @@ void VSettings::SetLabelLanguage(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetPathPattern() const { - return value(SettingPathsPattern, QDir::homePath()).toString(); + QSettings settings(this->format(), this->scope(), this->organizationName()); + return settings.value(SettingPathsPattern, QDir::homePath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VSettings::SetPathPattern(const QString &value) { - setValue(SettingPathsPattern, value); + QSettings settings(this->format(), this->scope(), this->organizationName()); + settings.setValue(SettingPathsPattern, value); + settings.sync(); } //--------------------------------------------------------------------------------------------------------------------- QString VSettings::GetPathLayout() const { - return value(SettingPathsLayout, QDir::homePath()).toString(); + QSettings settings(this->format(), this->scope(), this->organizationName()); + return settings.value(SettingPathsLayout, QDir::homePath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VSettings::SetPathLayout(const QString &value) { - setValue(SettingPathsLayout, value); + QSettings settings(this->format(), this->scope(), this->organizationName()); + settings.setValue(SettingPathsLayout, value); + settings.sync(); } //---------------------------------------------------------------------------------------------------------------------