From 0d9aedc087f56a3da35b6abc8a0ee233c2d2483b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 13 Apr 2025 20:06:58 +0530 Subject: Add downloads_dir configuration + auto-accept download requests --- src/widgets/BrowserApp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/widgets/BrowserApp.cpp') diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp index 4a43dfb..9b65b3a 100644 --- a/src/widgets/BrowserApp.cpp +++ b/src/widgets/BrowserApp.cpp @@ -20,6 +20,13 @@ BrowserApp::BrowserApp() { // NOTE: TMP lua.load_file_sync("./config.lua"); + // Initializes profile + QList profiles{&default_profile}; + for (auto *profile : profiles) { + profile->setDownloadPath(configuration.downloads_dir()); + profile->setHttpUserAgent(configuration.user_agent()); + } + connect(&window_action_router, &WindowActionRouter::new_window_requested, this, [this](const QUrl &url) { create_window({url.toString()}); }); }; @@ -28,6 +35,7 @@ BrowserWindow *BrowserApp::create_window(const QStringList &urls) { auto *window = new BrowserWindow((const Configuration &)configuration, urls); window->setWindowTitle("null-browser"); WindowActionRouter::instance().add_window(window); + window->show(); return window; } -- cgit v1.3.1