aports/testing/fxfloorboard-katana-mk2/use-standard-path-for-per-user-config.patch
2024-07-03 05:38:53 +00:00

28 lines
1.1 KiB
Diff

By default the application will write user-specific configuration files
to current working directory. This patch changes the location to
~/.config/fxfloorboard-katana-mk2.
--- a/main.cpp
+++ b/main.cpp
@@ -34,7 +34,7 @@
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QApplication app(argc, argv);
app.setOrganizationName("Gumtown");
- app.setApplicationName("Katana-MK2-FxFloorBoard");
+ app.setApplicationName("fxfloorboard-katana-mk2");
#ifdef Q_OS_ANDROID
//AndroidAskReadWriteRights(); // before creating the log file
@@ -55,6 +55,12 @@
QDir().setCurrent(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
//QDir().setCurrent("./Katana-MK2-FxFloorBoard");
#endif
+#ifdef Q_OS_LINUX
+ QString configLocation = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
+ QDir dir;
+ if (!dir.exists(configLocation)) { dir.mkpath(configLocation); }
+ dir.setCurrent(configLocation);
+#endif
Preferences *preferences = Preferences::Instance(); // Load the preferences.
QString lang = preferences->getPreferences("Language", "Locale", "select");