]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
.desktop: fix application file path
authortobtoht <tob@featherwallet.org>
Tue, 28 Nov 2023 00:34:35 +0000 (01:34 +0100)
committertobtoht <tob@featherwallet.org>
Tue, 28 Nov 2023 00:34:35 +0000 (01:34 +0100)
src/utils/Utils.cpp
src/utils/Utils.h

index 51545dde4e4f66360a53af3f00e996a894742cef..f942d03cfd0ee91f2ada63e79bff6a692a48002d 100644 (file)
@@ -202,6 +202,15 @@ QString applicationPath() {
     return applicationPath;
 }
 
+QString applicationFilePath() {
+    QString appimagePath = qgetenv("APPIMAGE");
+    if (!appimagePath.isEmpty()) {
+        return appimagePath;
+    }
+
+    return QApplication::applicationFilePath();
+}
+
 bool validateJSON(const QByteArray &blob) {
     QJsonDocument doc = QJsonDocument::fromJson(blob);
     QString jsonString = doc.toJson(QJsonDocument::Indented);
@@ -267,7 +276,7 @@ QString xdgDesktopEntry(){
             "Icon=feather\n"
             "Categories=Network;GNOME;Qt;\n"
             "StartupNotify=false\n"
-    ).arg(QApplication::applicationFilePath());
+    ).arg(applicationFilePath());
 }
 
 bool xdgDesktopEntryWrite(const QString &path){
index 936324651796d5a7f4b0f091cf486d24ba75210b..b43b450cde7f586a940568b78e2085dc64813391 100644 (file)
@@ -53,6 +53,7 @@ namespace Utils
     bool dirExists(const QString &path);
     QString defaultWalletDir();
     QString applicationPath();
+    QString applicationFilePath();
 
     bool validateJSON(const QByteArray &blob);
     bool readJsonFile(QIODevice &device, QSettings::SettingsMap &map);