aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/module/ModuleManager.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-27 12:18:26 +0000
committersaturneric <[email protected]>2024-07-27 12:18:26 +0000
commit5be04d1602355278814bc86c69ec9f648978be8c (patch)
tree6d691279591a267a6fe82bd3e9f84ced68dea214 /src/core/module/ModuleManager.h
parentfix: discover and solve some memory issues (diff)
downloadGpgFrontend-5be04d1602355278814bc86c69ec9f648978be8c.tar.gz
GpgFrontend-5be04d1602355278814bc86c69ec9f648978be8c.zip
feat: improve sdk api for pinentry module
Diffstat (limited to 'src/core/module/ModuleManager.h')
-rw-r--r--src/core/module/ModuleManager.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/module/ModuleManager.h b/src/core/module/ModuleManager.h
index ea2d88cb..08abbd27 100644
--- a/src/core/module/ModuleManager.h
+++ b/src/core/module/ModuleManager.h
@@ -28,7 +28,6 @@
#pragma once
-#include <mutex>
#include <vector>
#include "core/function/SecureMemoryAllocator.h"
@@ -123,10 +122,10 @@ void RegisterAndActivateModule(Args&&... args) {
}
template <typename... Args>
-void TriggerEvent(const EventIdentifier& event_id, Args&&... args,
+void TriggerEvent(const EventIdentifier& event_id,
+ const Event::Params& params = {},
Event::EventCallback e_cb = nullptr) {
- ModuleManager::GetInstance().TriggerEvent(
- std::move(MakeEvent(event_id, std::forward<Args>(args)..., e_cb)));
+ ModuleManager::GetInstance().TriggerEvent(MakeEvent(event_id, params, e_cb));
}
/**
@@ -166,13 +165,12 @@ auto GPGFRONTEND_CORE_EXPORT ListenRTPublishEvent(QObject*, Namespace, Key,
* @param key
* @return std::vector<Key>
*/
-auto GPGFRONTEND_CORE_EXPORT ListRTChildKeys(const QString& namespace_,
- const QString& key)
- -> std::vector<Key>;
+auto GPGFRONTEND_CORE_EXPORT ListRTChildKeys(
+ const QString& namespace_, const QString& key) -> std::vector<Key>;
template <typename T>
-auto RetrieveRTValueTyped(const QString& namespace_, const QString& key)
- -> std::optional<T> {
+auto RetrieveRTValueTyped(const QString& namespace_,
+ const QString& key) -> std::optional<T> {
auto any_value =
ModuleManager::GetInstance().RetrieveRTValue(namespace_, key);
if (any_value && any_value->type() == typeid(T)) {
@@ -183,8 +181,8 @@ auto RetrieveRTValueTyped(const QString& namespace_, const QString& key)
template <typename T>
auto RetrieveRTValueTypedOrDefault(const QString& namespace_,
- const QString& key, const T& defaultValue)
- -> T {
+ const QString& key,
+ const T& defaultValue) -> T {
auto any_value =
ModuleManager::GetInstance().RetrieveRTValue(namespace_, key);
if (any_value && any_value->type() == typeid(T)) {