aboutsummaryrefslogtreecommitdiff
path: root/src/WindowActionRouter.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-05 16:20:05 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-05 16:20:05 +0530
commit09cdcd15b31469c839831cad534fec9896999b60 (patch)
tree4aea664837807d06b2056c83191143fb9a8f3d54 /src/WindowActionRouter.cpp
parentc4413f3cca0a0750af9881276162b70f3489b499 (diff)
downloadnull-browser-09cdcd15b31469c839831cad534fec9896999b60.tar.gz
null-browser-09cdcd15b31469c839831cad534fec9896999b60.zip
Refactor event queue out of router
Diffstat (limited to '')
-rw-r--r--src/WindowActionRouter.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp
index e1d0664..8c80290 100644
--- a/src/WindowActionRouter.cpp
+++ b/src/WindowActionRouter.cpp
@@ -1,6 +1,5 @@
#include <QWidget>
#include <QtCore>
-#include <string>
#include <unordered_map>
#include "LuaRuntime.hpp"
@@ -10,35 +9,6 @@
#include "widgets/BrowserWindow.hpp"
#include "widgets/WebViewStack.hpp"
-void WindowActionRouter::dispatch_event(BrowserEvent *event) {
- auto &runtime = LuaRuntime::instance();
-
- runtime.queue_task([this, event]() {
- std::unordered_map<QString, std::vector<EventHandlerRequest>> event_map;
- {
- const std::lock_guard<std::mutex> lock(events_mutex);
- event_map = events;
- }
-
- if (!event_map.contains(event->kind))
- return;
-
- for (auto &event_handler : event_map.at(event->kind)) {
- // TODO: Pattern filter
- event_handler.handler(event);
- }
- });
-}
-
-void WindowActionRouter::register_event(const EventHandlerRequest &event) {
- const std::lock_guard<std::mutex> lock(events_mutex);
- for (const auto &event_name : event.event_names) {
- if (!events.contains(event_name))
- events.insert({event_name, {}});
- events.at(event_name).emplace_back(event);
- }
-}
-
void WindowActionRouter::initialize() {
auto &runtime = LuaRuntime::instance();