diff options
author | Saturneric <[email protected]> | 2023-10-24 13:22:13 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-10-24 13:42:16 +0000 |
commit | fa2e87a48acbc32650ca9db073b991729dfba622 (patch) | |
tree | 1076f6b2eac737d0559cd78e70b44975c789980e /src/core/module/GlobalModuleContext.cpp | |
parent | fix: solve build issues on macOS (diff) | |
download | GpgFrontend-fa2e87a48acbc32650ca9db073b991729dfba622.tar.gz GpgFrontend-fa2e87a48acbc32650ca9db073b991729dfba622.zip |
feat: use module instead of integrated code at version checking task
Diffstat (limited to 'src/core/module/GlobalModuleContext.cpp')
-rw-r--r-- | src/core/module/GlobalModuleContext.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/module/GlobalModuleContext.cpp b/src/core/module/GlobalModuleContext.cpp index 919c744a..1e6d87b1 100644 --- a/src/core/module/GlobalModuleContext.cpp +++ b/src/core/module/GlobalModuleContext.cpp @@ -270,6 +270,10 @@ class GlobalModuleContext::Impl { return true; } + bool IsModuleExists(ModuleIdentifier id) const { + return search_module_register_table(id).has_value(); + } + private: struct ModuleRegisterInfo { int channel; @@ -305,15 +309,13 @@ class GlobalModuleContext::Impl { // Function to search for a module in the register table. std::optional<ModuleRegisterInfoPtr> search_module_register_table( - ModuleIdentifier identifier) { + ModuleIdentifier identifier) const { auto it = module_register_table_.find(identifier); if (it == module_register_table_.end()) { return std::nullopt; } return it->second; } - - std::list<ModuleIdentifier>& search_module_events_table(ModuleIdentifier); }; // Constructor for GlobalModuleContext, takes a TaskRunnerPtr as an argument. @@ -368,4 +370,8 @@ int GlobalModuleContext::GetDefaultChannel(ModuleRawPtr _) { return p_->GetDefaultChannel(_); } +bool GlobalModuleContext::IsModuleExists(ModuleIdentifier id) { + return p_->IsModuleExists(id); +} + } // namespace GpgFrontend::Module |