aboutsummaryrefslogtreecommitdiff
path: root/src/WindowActionRouter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/WindowActionRouter.cpp')
-rw-r--r--src/WindowActionRouter.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp
index 4bac3ad..bba15d1 100644
--- a/src/WindowActionRouter.cpp
+++ b/src/WindowActionRouter.cpp
@@ -10,11 +10,7 @@
#include "widgets/WebViewStack.hpp"
QVariant WindowActionRouter::fetch_config_value(const QString &key) {
- if (key == "new_view_url")
- return configuration->new_view_url;
- if (key == "close_window_when_no_views")
- return configuration->close_window_when_no_views;
- return "";
+ return configuration->get_config(key);
}
// NOLINTNEXTLINE(readability-function-cognitive-complexity)
@@ -24,15 +20,7 @@ void WindowActionRouter::initialize(Configuration *config) {
connect(&runtime, &LuaRuntime::keymap_added, this, &WindowActionRouter::add_keymap);
- connect(&runtime, &LuaRuntime::config_updated, this,
- [this](const QString &key, const QVariant &value) {
- qDebug() << key << value;
- if (key == "new_view_url") {
- configuration->new_view_url = value.toString();
- } else if (key == "close_window_when_no_views") {
- configuration->close_window_when_no_views = value.toBool();
- }
- });
+ connect(&runtime, &LuaRuntime::config_updated, configuration, &Configuration::set_config);
connect(&runtime, &LuaRuntime::history_back_requested, this,
[this](WebViewId webview_id, qsizetype history_index) {