diff options
author | saturneric <[email protected]> | 2024-07-29 01:48:21 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-29 01:48:21 +0000 |
commit | 3dccd8cff1c3b063110e00112b0878de887daca3 (patch) | |
tree | 68fdeebd5ffe8bbbc53845559d7754bc8154976d /src/core/module/Event.cpp | |
parent | fix: copy is not the real one (diff) | |
download | GpgFrontend-3dccd8cff1c3b063110e00112b0878de887daca3.tar.gz GpgFrontend-3dccd8cff1c3b063110e00112b0878de887daca3.zip |
fix: solve qt5 problems
Diffstat (limited to 'src/core/module/Event.cpp')
-rw-r--r-- | src/core/module/Event.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/module/Event.cpp b/src/core/module/Event.cpp index cbffb096..6d39d7ba 100644 --- a/src/core/module/Event.cpp +++ b/src/core/module/Event.cpp @@ -104,6 +104,21 @@ class Event::Impl { GFModuleEventParam* p_param; int index = 0; + +#ifdef QT5_BUILD + for (auto it = data_.keyValueBegin(); it != data_.keyValueEnd(); ++it) { + p_param = static_cast<GFModuleEventParam*>( + SecureMalloc(sizeof(GFModuleEventParam))); + if (index++ == 0) event->params = p_param; + + p_param->name = GFStrDup(it->first); + p_param->value = GFStrDup(it->second); + p_param->next = nullptr; + + if (l_param != nullptr) l_param->next = p_param; + l_param = p_param; + } +#else for (const auto& data : data_.asKeyValueRange()) { p_param = static_cast<GFModuleEventParam*>( SecureMalloc(sizeof(GFModuleEventParam))); @@ -116,6 +131,7 @@ class Event::Impl { if (l_param != nullptr) l_param->next = p_param; l_param = p_param; } +#endif return event; } |