diff options
author | saturneric <[email protected]> | 2024-04-21 19:47:26 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-04-21 19:47:26 +0000 |
commit | 408eb98f5cc3c4278c04343fbe19e652a629d93d (patch) | |
tree | 827752b245ca02cb6b1a7cd2165c6c18c3d4316c | |
parent | fix: switch to qt 6.5 lts (diff) | |
download | GpgFrontend-dev/2.1.2/module.tar.gz GpgFrontend-dev/2.1.2/module.zip |
feat: adapt linux appimage of modules loadingdev/2.1.2/module
-rw-r--r-- | src/core/module/ModuleInit.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp index d74ea1c4..8932c97c 100644 --- a/src/core/module/ModuleInit.cpp +++ b/src/core/module/ModuleInit.cpp @@ -42,18 +42,19 @@ void LoadGpgFrontendModules(ModuleInitArgs) { Thread::TaskRunnerGetter::GetInstance().GetTaskRunner()->PostTask( new Thread::Task( [](const DataObjectPtr&) -> int { - GF_CORE_LOG_INFO("loading modules..."); - auto exec_binary_path = QCoreApplication::applicationDirPath(); auto mods_path = exec_binary_path + "/mods"; + if (!qEnvironmentVariable("APPIMAGE").isEmpty()) { + mods_path = qEnvironmentVariable("APPDIR") + "/usr/lib/mods"; + } + GF_CORE_LOG_DEBUG("try loading modules at path: {} ...", mods_path); if (!QDir(mods_path).exists()) { - GF_CORE_LOG_INFO("module directory not found, abort..."); + GF_CORE_LOG_WARN( + "module directory at path {} not found, abort...", mods_path); return -1; } - GF_CORE_LOG_INFO("the path of modules directory: {}", mods_path); - for (const auto& module_library_name : QDir(mods_path).entryList(QStringList() << "*.so" << "*.dll" @@ -63,7 +64,7 @@ void LoadGpgFrontendModules(ModuleInitArgs) { module_library_name); } - GF_CORE_LOG_INFO("load modules done."); + GF_CORE_LOG_DEBUG("load modules done."); return 0; }, "modules_system_init_task")); |