diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-04-13 20:06:58 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-04-13 21:06:23 +0530 |
| commit | 0d9aedc087f56a3da35b6abc8a0ee233c2d2483b (patch) | |
| tree | 533bb26e33358f601ac37eb12a897ba13d046667 /src/widgets/BrowserApp.cpp | |
| parent | bbe50215cbb9078ba457f93a5e90096e844c611a (diff) | |
| download | null-browser-0d9aedc087f56a3da35b6abc8a0ee233c2d2483b.tar.gz null-browser-0d9aedc087f56a3da35b6abc8a0ee233c2d2483b.zip | |
Add downloads_dir configuration + auto-accept download requests
Diffstat (limited to 'src/widgets/BrowserApp.cpp')
| -rw-r--r-- | src/widgets/BrowserApp.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |
