diff options
Diffstat (limited to 'src/core/function/GlobalSettingStation.cpp')
-rw-r--r-- | src/core/function/GlobalSettingStation.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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)}; |