diff --git a/doc/configuration.md b/doc/configuration.md index de5651782..c16e8f4bc 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -1,3 +1,26 @@ +# Gui Config + +The search path for settings ar as follows: + + - Check Install_path/settings/Deskflow.conf + - Check if User Settings Path + - Check if System Settings File + - Make a User Setting file + + The path of the settings file will be used as the base for all other config files + +### Windows + - System: `C:\ProgramData\Deskflow\Deskflow.conf` + - User: `C:\Users\userName\AppData\Local\Deskflow\Deskflow.conf` + +### Linux + - System: `/etc/Deskflow/Deskflow.conf` + - User: `~/.config/Deskflow/Deskflow.conf` + +### macOS + - System: `/Library/Deskflow/Deskflow.conf` + - User: `~/Library/Deskflow/Deskflow.conf` + # Server Config Examples The `deskflow-server` command accepts the `-c` or `--config` option, which takes one argument, diff --git a/src/lib/common/Settings.cpp b/src/lib/common/Settings.cpp index 1f1948e0f..bb95b9da9 100644 --- a/src/lib/common/Settings.cpp +++ b/src/lib/common/Settings.cpp @@ -8,6 +8,7 @@ #include "UrlConstants.h" +#include #include #include @@ -34,6 +35,7 @@ void Settings::setSettingFile(const QString &settingsFile) Settings::Settings(QObject *parent) : QObject(parent) { + m_portableSettingsFile = m_portableSettingsFile.arg(QCoreApplication::applicationDirPath(), kAppName); QString fileToLoad; if (QFile(m_portableSettingsFile).exists()) { fileToLoad = m_portableSettingsFile; diff --git a/src/lib/common/Settings.h b/src/lib/common/Settings.h index 554581e9f..af382ca4a 100644 --- a/src/lib/common/Settings.h +++ b/src/lib/common/Settings.h @@ -163,7 +163,7 @@ private: void cleanSettings(); QSettings *m_settings = nullptr; - QString m_portableSettingsFile = QStringLiteral("settings/%1.conf").arg(kAppName); + QString m_portableSettingsFile = QStringLiteral("%1/settings/%2.conf"); std::shared_ptr m_settingsProxy; // clang-format off