diff options
author | saturneric <[email protected]> | 2024-07-29 19:29:56 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-29 19:29:56 +0000 |
commit | fa90ec4b5315b9e70a44a9625c143ce253f0e885 (patch) | |
tree | 8ffa82e33522de03974d6d0289aa831b4fd6ebdf /src/core/module/ModuleInit.cpp | |
parent | fix: correct urls at appdata.xml (diff) | |
parent | Merge branch 'develop' of github.com:saturneric/GpgFrontend into develop (diff) | |
download | GpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.tar.gz GpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.zip |
Merge branch 'develop'
Diffstat (limited to 'src/core/module/ModuleInit.cpp')
-rw-r--r-- | src/core/module/ModuleInit.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp index ceb5987e..dc001798 100644 --- a/src/core/module/ModuleInit.cpp +++ b/src/core/module/ModuleInit.cpp @@ -39,11 +39,8 @@ namespace GpgFrontend::Module { void LoadModuleFromPath(const QString& mods_path, bool integrated) { - for (const auto& module_library_name : - QDir(mods_path).entryList(QStringList() << "*.so" - << "*.dll" - << "*.dylib", - QDir::Files)) { + for (const auto& module_library_name : QDir(mods_path).entryList( + QStringList() << "*.so" << "*.dll" << "*.dylib", QDir::Files)) { ModuleManager::GetInstance().LoadModule( mods_path + "/" + module_library_name, integrated); } @@ -54,34 +51,30 @@ auto LoadIntegratedMods() -> bool { #if defined(MACOS) && defined(RELEASE) // App Bundle - auto mods_path = exec_binary_path + "/../PlugIns/mods"; + auto mods_path = exec_binary_path + "/../Modules"; #else // Debug Or Windows Platform - auto mods_path = exec_binary_path + "/mods"; + auto mods_path = exec_binary_path + "/modules"; #endif // AppImage if (!qEnvironmentVariable("APPIMAGE").isEmpty()) { - mods_path = qEnvironmentVariable("APPDIR") + "/usr/plugins/mods"; + mods_path = qEnvironmentVariable("APPDIR") + "/usr/modules"; } // Flatpak if (!qEnvironmentVariable("container").isEmpty()) { - mods_path = "/app/lib/mods"; + mods_path = "/app/modules"; } - GF_CORE_LOG_DEBUG("try loading integrated modules at path: {} ...", - mods_path); if (!QDir(mods_path).exists()) { - GF_CORE_LOG_WARN( - "integrated module directory at path {} not found, abort...", - mods_path); + qCWarning(core) << "integrated module directory at path: " << mods_path + << " not found, abort..."; return false; } LoadModuleFromPath(mods_path, true); - GF_CORE_LOG_DEBUG("load integrated modules done."); return true; } @@ -89,16 +82,14 @@ auto LoadExternalMods() -> bool { auto mods_path = GpgFrontend::GlobalSettingStation::GetInstance().GetModulesDir(); - GF_CORE_LOG_DEBUG("try loading external modules at path: {} ...", mods_path); if (!QDir(mods_path).exists()) { - GF_CORE_LOG_WARN("external module directory at path {} not found, abort...", - mods_path); + qCWarning(core) << "external module directory at path " << mods_path + << " not found, abort..."; return false; } LoadModuleFromPath(mods_path, false); - GF_CORE_LOG_DEBUG("load integrated modules done."); return true; } |