diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp index 51545dd..f942d03 100644 --- a/src/utils/Utils.cpp +++ b/src/utils/Utils.cpp @@ -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){ diff --git a/src/utils/Utils.h b/src/utils/Utils.h index 9363246..b43b450 100644 --- a/src/utils/Utils.h +++ b/src/utils/Utils.h @@ -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);