From bc52ba74b461145212c999f4c2435125768f24ef Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 12 Jul 2024 15:18:34 +0200 Subject: feat: adjust modules loading path --- src/core/module/ModuleInit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/module/ModuleInit.cpp') diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp index ceb5987e..cfeff3df 100644 --- a/src/core/module/ModuleInit.cpp +++ b/src/core/module/ModuleInit.cpp @@ -54,20 +54,20 @@ 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: {} ...", -- cgit v1.2.3 From 37a62a8d0b590710b902376ca3320cc05e954b63 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 26 Jul 2024 18:24:34 +0200 Subject: feat: remove spdlog and clean up log --- src/core/module/ModuleInit.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/core/module/ModuleInit.cpp') diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp index cfeff3df..0e41e949 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); } @@ -70,18 +67,15 @@ auto LoadIntegratedMods() -> bool { 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."); + qCDebug(core, "load integrated modules done."); return true; } @@ -89,16 +83,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; } -- cgit v1.2.3 From 1c4445408577a3bd5743d344cdd31f21d81dc9c0 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sat, 27 Jul 2024 10:56:19 +0200 Subject: fix: discover and solve some memory issues --- src/core/module/ModuleInit.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/module/ModuleInit.cpp') diff --git a/src/core/module/ModuleInit.cpp b/src/core/module/ModuleInit.cpp index 0e41e949..dc001798 100644 --- a/src/core/module/ModuleInit.cpp +++ b/src/core/module/ModuleInit.cpp @@ -68,14 +68,13 @@ auto LoadIntegratedMods() -> bool { } if (!QDir(mods_path).exists()) { - qCWarning(core) << "integrated module directory at path " << mods_path + qCWarning(core) << "integrated module directory at path: " << mods_path << " not found, abort..."; return false; } LoadModuleFromPath(mods_path, true); - qCDebug(core, "load integrated modules done."); return true; } -- cgit v1.2.3