diff --git a/src/app/puzzle/vpapplication.cpp b/src/app/puzzle/vpapplication.cpp index 9cd5859d3..618f8d1cf 100644 --- a/src/app/puzzle/vpapplication.cpp +++ b/src/app/puzzle/vpapplication.cpp @@ -492,6 +492,13 @@ auto VPApplication::TrVars() -> const VTranslateVars * //--------------------------------------------------------------------------------------------------------------------- void VPApplication::OpenSettings() { +#if defined(Q_OS_WIN) + QString const docPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (!docPath.isEmpty()) + { + QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, docPath); + } +#endif settings = new VPSettings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName(), this); connect(settings, &VPSettings::SVGFontsPathChanged, this, &VPApplication::SVGFontsPathChanged); diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index af6faab33..fc12b1938 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -614,6 +614,13 @@ void MApplication::AboutToQuit() //--------------------------------------------------------------------------------------------------------------------- void MApplication::OpenSettings() { +#if defined(Q_OS_WIN) + QString const docPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (!docPath.isEmpty()) + { + QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, docPath); + } +#endif settings = new VTapeSettings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName(), this); connect(settings, &VTapeSettings::SVGFontsPathChanged, this, &MApplication::SVGFontsPathChanged); diff --git a/src/libs/vmisc/vabstractvalapplication.cpp b/src/libs/vmisc/vabstractvalapplication.cpp index f697bfef6..8ff682358 100644 --- a/src/libs/vmisc/vabstractvalapplication.cpp +++ b/src/libs/vmisc/vabstractvalapplication.cpp @@ -71,6 +71,13 @@ void VAbstractValApplication::PostWarningMessage(const QString &message, QtMsgTy */ void VAbstractValApplication::OpenSettings() { +#if defined(Q_OS_WIN) + QString const docPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (!docPath.isEmpty()) + { + QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, docPath); + } +#endif settings = new VValentinaSettings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName(), this); connect(settings, &VValentinaSettings::SVGFontsPathChanged, this, &VAbstractValApplication::SVGFontsPathChanged); diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 47eb3927f..f371f8dd2 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -347,7 +347,19 @@ void VCommonSettings::SetPathCustomImage(const QString &value) //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::GetDefPathSVGFonts() -> QString { - return QDir::homePath() + QStringLiteral("/valentina/svg fonts"); + QString const defPath = QStringList{QDir::homePath(), "Valentina"_L1, "Svg fonts"_L1}.join(QDir::separator()); + +#if defined(Q_OS_WIN) + QString const docPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (docPath.isEmpty()) + { + return defPath; + } + + return QStringList{docPath, "Valentina"_L1, "Svg fonts"_L1}.join(QDir::separator()); +#else + return defPath; +#endif } //--------------------------------------------------------------------------------------------------------------------- @@ -375,7 +387,20 @@ void VCommonSettings::SetPathSVGFonts(const QString &value) //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::GetDefPathFontCorrections() -> QString { - return QDir::homePath() + "/valentina/font corrections"_L1; + QString const defPath = + QStringList{QDir::homePath(), "Valentina"_L1, "Font corrections"_L1}.join(QDir::separator()); + +#if defined(Q_OS_WIN) + QString const docPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (docPath.isEmpty()) + { + return defPath; + } + + return QStringList{docPath, "Valentina"_L1, "Font corrections"_L1}.join(QDir::separator()); +#else + return defPath; +#endif } //--------------------------------------------------------------------------------------------------------------------- @@ -396,7 +421,20 @@ void VCommonSettings::SetPathFontCorrections(const QString &value) //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::GetDefPathKnownMeasurements() -> QString { - return QDir::homePath() + "/valentina/known measurements"_L1; + QString const defPath = + QStringList{QDir::homePath(), "Valentina"_L1, "Known measurements"_L1}.join(QDir::separator()); + +#if defined(Q_OS_WIN) + QString const docPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (docPath.isEmpty()) + { + return defPath; + } + + return QStringList{docPath, "Valentina"_L1, "Known measurements"_L1}.join(QDir::separator()); +#else + return defPath; +#endif } //---------------------------------------------------------------------------------------------------------------------