aboutsummaryrefslogtreecommitdiff
path: root/src/WindowMediator.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-13 20:06:58 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-13 21:06:23 +0530
commit0d9aedc087f56a3da35b6abc8a0ee233c2d2483b (patch)
tree533bb26e33358f601ac37eb12a897ba13d046667 /src/WindowMediator.cpp
parentbbe50215cbb9078ba457f93a5e90096e844c611a (diff)
downloadnull-browser-0d9aedc087f56a3da35b6abc8a0ee233c2d2483b.tar.gz
null-browser-0d9aedc087f56a3da35b6abc8a0ee233c2d2483b.zip
Add downloads_dir configuration + auto-accept download requests
Diffstat (limited to 'src/WindowMediator.cpp')
-rw-r--r--src/WindowMediator.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/WindowMediator.cpp b/src/WindowMediator.cpp
index a2ff2a6..f27e009 100644
--- a/src/WindowMediator.cpp
+++ b/src/WindowMediator.cpp
@@ -16,9 +16,6 @@ WindowMediator::WindowMediator(WebViewStack *webview_stack) : webview_stack(webv
connect(this, &WindowMediator::webview_closed, webview_stack, &WebViewStack::close);
connect(this, &WindowMediator::webview_selected, webview_stack, &WebViewStack::focus_webview);
- auto *profile = webview_stack->get_profile();
- connect(this, &WindowMediator::set_user_agent, profile, &QWebEngineProfile::setHttpUserAgent);
-
// Delegate signal
connect(webview_stack, &WebViewStack::new_window_requested, this,
&WindowMediator::new_window_requested);
@@ -26,6 +23,17 @@ WindowMediator::WindowMediator(WebViewStack *webview_stack) : webview_stack(webv
&WindowMediator::close_window_requested);
}
+void WindowMediator::update_user_agent(const QString &user_agent) {
+ auto *profile = webview_stack->get_profile();
+ profile->setHttpUserAgent(user_agent);
+}
+
+void WindowMediator::update_downloads_dir(const QString &downloads_dir) {
+ qDebug() << "::: dl in med" << downloads_dir;
+ auto *profile = webview_stack->get_profile();
+ profile->setDownloadPath(downloads_dir);
+}
+
WindowMediator::~WindowMediator() {
disconnect(this);
delete webview_stack;