diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-12 11:56:10 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-04-12 11:56:35 +0530 |
| commit | f3f109cd054888f857d51ca2b37b4123f3134069 (patch) | |
| tree | 81250db8a30f85d34d3c101830a37e3535e77054 /src/widgets | |
| parent | c0ee5203201d4ddf4ed560f856cb0da958935fc6 (diff) | |
| download | null-browser-f3f109cd054888f857d51ca2b37b4123f3134069.tar.gz null-browser-f3f109cd054888f857d51ca2b37b4123f3134069.zip | |
Add configuration api
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/BrowserApp.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/BrowserWindow.cpp | 2 | ||||
| -rw-r--r-- | src/widgets/WebViewStack.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp index 26124d6..4a43dfb 100644 --- a/src/widgets/BrowserApp.cpp +++ b/src/widgets/BrowserApp.cpp @@ -12,13 +12,13 @@ BrowserApp::BrowserApp() { // Router init auto &window_action_router = WindowActionRouter::instance(); - window_action_router.initialize(); + window_action_router.initialize(&configuration); // Global event filter qApp->installEventFilter(this); // NOTE: TMP - lua.load_file("./config.lua"); + lua.load_file_sync("./config.lua"); connect(&window_action_router, &WindowActionRouter::new_window_requested, this, [this](const QUrl &url) { create_window({url.toString()}); }); diff --git a/src/widgets/BrowserWindow.cpp b/src/widgets/BrowserWindow.cpp index cc3c6a8..2c4c5b4 100644 --- a/src/widgets/BrowserWindow.cpp +++ b/src/widgets/BrowserWindow.cpp @@ -27,7 +27,7 @@ BrowserWindow::BrowserWindow(const Configuration &configuration, const QStringLi // Open webviews for given urls if (urls.isEmpty()) { - webview_stack->open_url(configuration.new_view_url.toString()); + webview_stack->open_url(configuration.new_view_url); } else { for (const auto &url : urls) { webview_stack->open_url(url, OpenType::OpenUrlInView); diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp index d43c9b5..f15ab64 100644 --- a/src/widgets/WebViewStack.cpp +++ b/src/widgets/WebViewStack.cpp @@ -204,7 +204,7 @@ QUrl WebViewStack::current_url() { auto *webview = current_webview(); if (webview == nullptr) { qDebug() << "No current webview"; - return configuration->new_view_url; + return QUrl{configuration->new_view_url}; } return webview->url(); |
