From 8735357fbf48941e2629f7232f08cd1458936664 Mon Sep 17 00:00:00 2001 From: Holger Pandel Date: Fri, 10 Jun 2016 15:57:08 +0200 Subject: [PATCH 1/2] Resolve issue #508. Settings saved to INI files in different folders. --HG-- branch : feature --- ChangeLog.txt | 1 + src/libs/vmisc/vcommonsettings.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8c7aec59e..e02ad958c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,5 @@ # Version 0.5.0 +- [#508] Settings saved to INI files in different folders. - [#193] Undeletable zombie arc objects. - New feature. Groups. - Tool "Curve intersect axis" store data about subpaths. diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 2093f1b50..6ee01c00a 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -115,14 +115,14 @@ QString VCommonSettings::StandardTablesPath() const //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::GetPathIndividualMeasurements() const { - QSettings settings(this->format(), this->scope(), this->organizationName()); + QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); return settings.value(SettingPathsIndividualMeasurements, QDir::homePath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VCommonSettings::SetPathIndividualMeasurements(const QString &value) { - QSettings settings(this->format(), this->scope(), this->organizationName()); + QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); settings.setValue(SettingPathsIndividualMeasurements, value); settings.sync(); } @@ -130,14 +130,14 @@ void VCommonSettings::SetPathIndividualMeasurements(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::GetPathStandardMeasurements() const { - QSettings settings(this->format(), this->scope(), this->organizationName()); + QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); return settings.value(SettingPathsStandardMeasurements, StandardTablesPath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VCommonSettings::SetPathStandardMeasurements(const QString &value) { - QSettings settings(this->format(), this->scope(), this->organizationName()); + QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); settings.setValue(SettingPathsStandardMeasurements, value); settings.sync(); } @@ -146,14 +146,14 @@ void VCommonSettings::SetPathStandardMeasurements(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::GetPathTemplate() const { - QSettings settings(this->format(), this->scope(), this->organizationName()); + QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); return settings.value(SettingPathsTemplates, TemplatesPath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VCommonSettings::SetPathTemplate(const QString &value) { - QSettings settings(this->format(), this->scope(), this->organizationName()); + QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); settings.setValue(SettingPathsTemplates, value); settings.sync(); } From 349625fbed573928b54509c8b933bf5d1ff80d99 Mon Sep 17 00:00:00 2001 From: Holger Pandel Date: Fri, 10 Jun 2016 16:48:30 +0200 Subject: [PATCH 2/2] Create string variable for ini file name identifier. --HG-- branch : feature --- src/libs/vmisc/vcommonsettings.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 6ee01c00a..35fc9d9c1 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -65,6 +65,8 @@ const QString VCommonSettings::SettingGeneralGeometry = QString const QString VCommonSettings::SettingGeneralWindowState = QStringLiteral("windowState"); const QString VCommonSettings::SettingGeneralToolbarsState = QStringLiteral("toolbarsState"); +static const QString commonIniFilename = QStringLiteral("common"); + //--------------------------------------------------------------------------------------------------------------------- VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application, QObject *parent) @@ -115,14 +117,14 @@ QString VCommonSettings::StandardTablesPath() const //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::GetPathIndividualMeasurements() const { - QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); + QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename); return settings.value(SettingPathsIndividualMeasurements, QDir::homePath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VCommonSettings::SetPathIndividualMeasurements(const QString &value) { - QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); + QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename); settings.setValue(SettingPathsIndividualMeasurements, value); settings.sync(); } @@ -130,14 +132,14 @@ void VCommonSettings::SetPathIndividualMeasurements(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::GetPathStandardMeasurements() const { - QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); + QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename); return settings.value(SettingPathsStandardMeasurements, StandardTablesPath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VCommonSettings::SetPathStandardMeasurements(const QString &value) { - QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); + QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename); settings.setValue(SettingPathsStandardMeasurements, value); settings.sync(); } @@ -146,14 +148,14 @@ void VCommonSettings::SetPathStandardMeasurements(const QString &value) //--------------------------------------------------------------------------------------------------------------------- QString VCommonSettings::GetPathTemplate() const { - QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); + QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename); return settings.value(SettingPathsTemplates, TemplatesPath()).toString(); } //--------------------------------------------------------------------------------------------------------------------- void VCommonSettings::SetPathTemplate(const QString &value) { - QSettings settings(this->format(), this->scope(), this->organizationName(), "common"); + QSettings settings(this->format(), this->scope(), this->organizationName(), commonIniFilename); settings.setValue(SettingPathsTemplates, value); settings.sync(); }