From 9f61a1f86ca85da52a13a57290db95655cd5740e Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 12 Jul 2024 14:53:16 +0200 Subject: feat: improve the project structure --- src/core/module/Module.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/module/Module.cpp') diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp index 9c875fce..202f9d81 100644 --- a/src/core/module/Module.cpp +++ b/src/core/module/Module.cpp @@ -31,7 +31,7 @@ #include "core/module/GlobalModuleContext.h" #include "core/utils/CommonUtils.h" #include "core/utils/IOUtils.h" -#include "module/sdk/GFSDKModule.h" +#include "sdk/GFSDKModule.h" #include "utils/BuildInfoUtils.h" namespace GpgFrontend::Module { -- cgit v1.2.3 From d1d6859e2a50a78f57388ebf0a06f0636d4d0910 Mon Sep 17 00:00:00 2001 From: saturneric Date: Fri, 12 Jul 2024 20:38:16 +0200 Subject: feat: add some ui apis to sdk --- src/core/module/Module.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/module/Module.cpp') diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp index 202f9d81..8faae4e0 100644 --- a/src/core/module/Module.cpp +++ b/src/core/module/Module.cpp @@ -34,6 +34,8 @@ #include "sdk/GFSDKModule.h" #include "utils/BuildInfoUtils.h" + + namespace GpgFrontend::Module { class Module::Impl { -- 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/Module.cpp | 53 +++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) (limited to 'src/core/module/Module.cpp') diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp index 8faae4e0..ea2fea08 100644 --- a/src/core/module/Module.cpp +++ b/src/core/module/Module.cpp @@ -34,8 +34,6 @@ #include "sdk/GFSDKModule.h" #include "utils/BuildInfoUtils.h" - - namespace GpgFrontend::Module { class Module::Impl { @@ -61,9 +59,9 @@ class Module::Impl { *required_symbol.pointer = reinterpret_cast(module_library.resolve(required_symbol.name)); if (*required_symbol.pointer == nullptr) { - GF_CORE_LOG_WARN( - "illegal module: {}, reason: cannot load symbol: {}, abort...", - module_library.fileName(), required_symbol.name); + qCWarning(core) << "illegal module: " << module_library.fileName() + << ", reason cannot load symbol: " + << required_symbol.name << ", abort..."; return; } } @@ -74,39 +72,38 @@ class Module::Impl { qt_env_ver_ = GFUnStrDup(get_qt_ver_api_()); if (!module_identifier_regex_exp_.match(identifier_).hasMatch()) { - GF_CORE_LOG_WARN( - "illegal module: {}, reasson invalid module id, abort...", - identifier_); + qCWarning(core) << "illegal module: " << identifier_ + << ", reason invalid module id, abort..."; return; } if (!module_version_regex_exp_.match(version_).hasMatch()) { - GF_CORE_LOG_WARN( - "illegal module: {}, reasson invalid version: {}, abort...", - identifier_, version_); + qCWarning(core) << "illegal module: " << identifier_ + << ", reason invalid version: " << version_ + << ", abort..."; return; } if (!module_version_regex_exp_.match(gf_sdk_ver_).hasMatch()) { - GF_CORE_LOG_WARN( - "illegal module: {}, reasson invalid sdk version: {}, abort...", - identifier_, gf_sdk_ver_); + qCWarning(core) << "illegal module: " << identifier_ + << ", reason invalid sdk version: " << gf_sdk_ver_ + << ", abort..."; return; } if (GFCompareSoftwareVersion(gf_sdk_ver_, GetProjectVersion()) > 0) { - GF_CORE_LOG_WARN( - "uncompatible module: {}, sdk version: {} greater than " - "current sdk version: {}, abort...", - identifier_, gf_sdk_ver_, GetProjectVersion()); + qCWarning(core) << "uncompatible module: " << identifier_ + << ", reason sdk version: " << gf_sdk_ver_ + << "current sdk version: " << GetProjectVersion() + << ", abort..."; return; } auto qt_env_ver_regex_match = module_version_regex_exp_.match(qt_env_ver_); if (!qt_env_ver_regex_match.hasMatch()) { - GF_CORE_LOG_WARN( - "illegal module: {}, reasson invalid qt env version: {}, abort...", - identifier_, qt_env_ver_); + qCWarning(core) << "illegal module: " << identifier_ + << ", reason invalid qt env version: " << qt_env_ver_ + << ", abort..."; return; } @@ -115,19 +112,13 @@ class Module::Impl { if (qt_env_ver_major != QString::number(QT_VERSION_MAJOR) + "." || qt_env_ver_minor != QString::number(QT_VERSION_MINOR) + ".") { - GF_CORE_LOG_WARN( - "uncompatible module: {}, qt version: {} is not binary uncompatible " - "with application's qt env version: {}, abort...", - identifier_, qt_env_ver_, QString::fromUtf8(QT_VERSION_STR)); + qCWarning(core) << "uncompatible module: " << identifier_ + << ", reason sdk version: " << qt_env_ver_ + << "current sdk version: " + << QString::fromUtf8(QT_VERSION_STR) << ", abort..."; return; } - GF_CORE_LOG_INFO( - "module loaded, id: {}, version: {}, " - "sdk version: {}, qt env version: {}, hash: {}, path: {}", - identifier_, version_, gf_sdk_ver_, qt_env_ver_, module_hash_, - module_library_path_); - ::GFModuleMetaData* p_meta_data = get_metadata_api_(); while (p_meta_data != nullptr) { -- cgit v1.2.3 From adc5d89717cc1498c69792799c74ace413cca713 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 28 Jul 2024 17:07:15 +0200 Subject: fix: correct the spelling of 'deactivate' --- src/core/module/Module.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/module/Module.cpp') diff --git a/src/core/module/Module.cpp b/src/core/module/Module.cpp index ea2fea08..78a8810f 100644 --- a/src/core/module/Module.cpp +++ b/src/core/module/Module.cpp @@ -152,7 +152,7 @@ class Module::Impl { return -1; } - auto Deactive() -> int { + auto Deactivate() -> int { if (good_ && deactivate_api_ != nullptr) return deactivate_api_(); return -1; } @@ -248,7 +248,7 @@ class Module::Impl { {"GFRegisterModule", reinterpret_cast(®ister_api_)}, {"GFActiveModule", reinterpret_cast(&activate_api_)}, {"GFExecuteModule", reinterpret_cast(&execute_api_)}, - {"GFDeactiveModule", reinterpret_cast(&deactivate_api_)}, + {"GFDeactivateModule", reinterpret_cast(&deactivate_api_)}, {"GFUnregisterModule", reinterpret_cast(&unregister_api_)}, }; @@ -279,7 +279,7 @@ auto Module::Exec(EventReference event) -> int { return p_->Exec(std::move(event)); } -auto Module::Deactive() -> int { return p_->Deactive(); } +auto Module::Deactivate() -> int { return p_->Deactivate(); } auto Module::UnRegister() -> int { return p_->UnRegister(); } -- cgit v1.2.3