From 92be7f8da6076311b996a184c76781c07608cc9f Mon Sep 17 00:00:00 2001 From: saturneric Date: Thu, 17 Apr 2025 21:59:01 +0200 Subject: fix: issues found on linux platform --- src/core/function/GlobalSettingStation.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/core/function/GlobalSettingStation.cpp') diff --git a/src/core/function/GlobalSettingStation.cpp b/src/core/function/GlobalSettingStation.cpp index 62b24331..3c0dda88 100644 --- a/src/core/function/GlobalSettingStation.cpp +++ b/src/core/function/GlobalSettingStation.cpp @@ -48,6 +48,15 @@ class GlobalSettingStation::Impl { Module::UpsertRTValue("core", "env.state.portable", 1); LOG_I() << "GpgFrontend runs in the portable mode now"; +#if defined(__linux__) + if (!qEnvironmentVariable("APPIMAGE").isEmpty()) { + LOG_I() << "app image path: " << qEnvironmentVariable("APPIMAGE"); + QFileInfo info( + QString::fromUtf8(qEnvironmentVariable("APPIMAGE").toUtf8())); + app_path_ = info.canonicalPath(); + } +#endif + app_data_path_ = QDir(app_path_ + "/../").canonicalPath(); app_config_path_ = app_data_path_ + "/config"; @@ -197,7 +206,7 @@ class GlobalSettingStation::Impl { } bool portable_mode_ = false; - const QString app_path_ = QCoreApplication::applicationDirPath(); + QString app_path_ = QCoreApplication::applicationDirPath(); QString working_path_ = QDir::currentPath(); QString app_data_path_ = QString{ QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)}; -- cgit v1.2.3