.desktop: fix application file path

This commit is contained in:
tobtoht 2023-11-28 01:34:35 +01:00
parent 204cdde39d
commit a73d715b72
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
2 changed files with 11 additions and 1 deletions

View 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){

View 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);