Create string variable for ini file name identifier.

--HG--
branch : feature
This commit is contained in:
Holger Pandel 2016-06-10 16:48:30 +02:00
parent 8735357fbf
commit 349625fbed

View File

@ -65,6 +65,8 @@ const QString VCommonSettings::SettingGeneralGeometry = QString
const QString VCommonSettings::SettingGeneralWindowState = QStringLiteral("windowState"); const QString VCommonSettings::SettingGeneralWindowState = QStringLiteral("windowState");
const QString VCommonSettings::SettingGeneralToolbarsState = QStringLiteral("toolbarsState"); const QString VCommonSettings::SettingGeneralToolbarsState = QStringLiteral("toolbarsState");
static const QString commonIniFilename = QStringLiteral("common");
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &organization, VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &organization,
const QString &application, QObject *parent) const QString &application, QObject *parent)
@ -115,14 +117,14 @@ QString VCommonSettings::StandardTablesPath() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathIndividualMeasurements() 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(); return settings.value(SettingPathsIndividualMeasurements, QDir::homePath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathIndividualMeasurements(const QString &value) 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.setValue(SettingPathsIndividualMeasurements, value);
settings.sync(); settings.sync();
} }
@ -130,14 +132,14 @@ void VCommonSettings::SetPathIndividualMeasurements(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathStandardMeasurements() const 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(); return settings.value(SettingPathsStandardMeasurements, StandardTablesPath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathStandardMeasurements(const QString &value) 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.setValue(SettingPathsStandardMeasurements, value);
settings.sync(); settings.sync();
} }
@ -146,14 +148,14 @@ void VCommonSettings::SetPathStandardMeasurements(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathTemplate() const 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(); return settings.value(SettingPathsTemplates, TemplatesPath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathTemplate(const QString &value) 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.setValue(SettingPathsTemplates, value);
settings.sync(); settings.sync();
} }