We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.

view app-misc/qutescoop/files/userdir.patch @ 270:1f63b8967e67

[sync] imported 2baaee6..19745ea from upstream commit 19745ea9f933d1e57c3dc82cccf1bc2f0dfed148 Author: Daniel Neugebauer <dneuge@energiequant.de> Date: Wed May 7 11:24:22 2025 +0200 media-gfx/trimage: PyQt5 has been renamed to pyqt5, fix dependency resolution
author Migration Sync <gentoo-overlay@megacoffee.net>
date Wed, 07 May 2025 09:30:02 +0000
parents ece4c118e053
children
line wrap: on
line source

diff --git a/src/Settings.cpp b/src/Settings.cpp
index 040fa65..4f21092 100644
--- a/src/Settings.cpp
+++ b/src/Settings.cpp
@@ -1,5 +1,7 @@
 #include "Settings.h"
 
+#include <QStandardPaths>
+
 #include "GuiMessage.h"
 #include "Whazzup.h"
 #include "dialogs/AirportDetails.h"
@@ -198,6 +200,14 @@ void Settings::importFromFile(QString fileName) {
  * @returns fully qualified path to the 'application data directory'.
  **/
 QString Settings::dataDirectory(const QString &composeFilePath) {
+    // try local data directory first, use if it exists
+    QString appLocalDataPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
+    QDir appLocalDataDir(appLocalDataPath);
+    if (appLocalDataDir.exists()) {
+        return QString("%1/%2").arg(appLocalDataPath, composeFilePath);
+    }
+
+    // fall back to installation directory
     return QString("%1/%2")
         .arg(QCoreApplication::applicationDirPath(), composeFilePath);
 }