Resolved issue #354. Save valentina.exe Path Preferences to a file accessible by tape.exe

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-10-18 12:56:47 +03:00
parent 3551d46490
commit de12c77aa4
2 changed files with 12 additions and 7 deletions

View File

@ -65,33 +65,35 @@ const QString VCommonSettings::SettingGeneralWindowState = QString
const QString VCommonSettings::SettingGeneralToolbarsState = QStringLiteral("toolbarsState"); const QString VCommonSettings::SettingGeneralToolbarsState = QStringLiteral("toolbarsState");
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application, VCommonSettings::VCommonSettings(Format format, Scope scope, const QString &organization,
QObject *parent) const QString &application, QObject *parent)
:QSettings(format, scope, organization, application, parent) :QSettings(format, scope, organization, application, parent), commonSettings(format, scope, organization)
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathIndividualMeasurements() const QString VCommonSettings::GetPathIndividualMeasurements() const
{ {
return value(SettingPathsIndividualMeasurements, QDir::homePath()).toString(); QSettings settings(commonSettings.format(), commonSettings.scope(), commonSettings.organizationName());
return settings.value(SettingPathsIndividualMeasurements, QDir::homePath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathIndividualMeasurements(const QString &value) void VCommonSettings::SetPathIndividualMeasurements(const QString &value)
{ {
setValue(SettingPathsIndividualMeasurements, value); commonSettings.setValue(SettingPathsIndividualMeasurements, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VCommonSettings::GetPathStandardMeasurements() const QString VCommonSettings::GetPathStandardMeasurements() const
{ {
return value(SettingPathsStandardMeasurements, StandardTablesPath()).toString(); QSettings settings(commonSettings.format(), commonSettings.scope(), commonSettings.organizationName());
return settings.value(SettingPathsStandardMeasurements, StandardTablesPath()).toString();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetPathStandardMeasurements(const QString &value) void VCommonSettings::SetPathStandardMeasurements(const QString &value)
{ {
setValue(SettingPathsStandardMeasurements, value); commonSettings.setValue(SettingPathsStandardMeasurements, value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -97,6 +97,9 @@ 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;