Save valentina.exe Path Preferences to a file accessible by tape.exe without commonSettings

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-10-18 14:51:14 +03:00
parent e16943cfa2
commit d146d381e8
2 changed files with 10 additions and 9 deletions

View File

@ -68,47 +68,50 @@ const QString VCommonSettings::SettingGeneralToolbarsState = QString
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
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)
:QSettings(format, scope, organization, application, parent), commonSettings(format, scope, organization) :QSettings(format, scope, organization, application, parent)
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathIndividualMeasurements() const QString VCommonSettings::GetPathIndividualMeasurements() const
{ {
QSettings settings(commonSettings.format(), commonSettings.scope(), commonSettings.organizationName()); QSettings settings(this->format(), this->scope(), this->organizationName());
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)
{ {
commonSettings.setValue(SettingPathsIndividualMeasurements, value); QSettings settings(this->format(), this->scope(), this->organizationName());
settings.setValue(SettingPathsIndividualMeasurements, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathStandardMeasurements() const QString VCommonSettings::GetPathStandardMeasurements() const
{ {
QSettings settings(commonSettings.format(), commonSettings.scope(), commonSettings.organizationName()); QSettings settings(this->format(), this->scope(), this->organizationName());
return settings.value(SettingPathsStandardMeasurements, StandardTablesPath()).toString(); return settings.value(SettingPathsStandardMeasurements, StandardTablesPath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathStandardMeasurements(const QString &value) void VCommonSettings::SetPathStandardMeasurements(const QString &value)
{ {
commonSettings.setValue(SettingPathsStandardMeasurements, value); QSettings settings(this->format(), this->scope(), this->organizationName());
settings.setValue(SettingPathsStandardMeasurements, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathTemplate() const QString VCommonSettings::GetPathTemplate() const
{ {
QSettings settings(commonSettings.format(), commonSettings.scope(), commonSettings.organizationName()); QSettings settings(this->format(), this->scope(), this->organizationName());
return settings.value(SettingPathsTemplates, TemplatesPath()).toString(); return settings.value(SettingPathsTemplates, TemplatesPath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathTemplate(const QString &value) void VCommonSettings::SetPathTemplate(const QString &value)
{ {
commonSettings.setValue(SettingPathsTemplates, value); QSettings settings(this->format(), this->scope(), this->organizationName());
settings.setValue(SettingPathsTemplates, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -102,8 +102,6 @@ public:
private: private:
Q_DISABLE_COPY(VCommonSettings) Q_DISABLE_COPY(VCommonSettings)
QSettings commonSettings;
static const QString SettingPathsIndividualMeasurements; static const QString SettingPathsIndividualMeasurements;
static const QString SettingPathsStandardMeasurements; static const QString SettingPathsStandardMeasurements;
static const QString SettingPathsTemplates; static const QString SettingPathsTemplates;