aboutsummaryrefslogtreecommitdiff
path: root/src/WindowMediator.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;