aboutsummaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/browser.cpp')
-rw-r--r--src/browser.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index f4cadb5..7a169e9 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -57,12 +57,14 @@ void Browser::loadProfiles()
for(const QString &name : profileList) {
std::shared_ptr<WebEngineProfile> profile = std::make_shared<WebEngineProfile>(name, profileDir.absoluteFilePath(name), nullptr);
profile->setRequestInterceptor(m_urlRequestInterceptor.get());
+ connect(profile.get(), &WebEngineProfile::downloadRequested, m_downloadManager.get(), &DownloadsWidget::addDownload);
m_profiles.insert(name, profile);
}
// Also add the Off-the-record profile
std::shared_ptr<WebEngineProfile> otr = std::make_shared<WebEngineProfile>(nullptr);
otr->setRequestInterceptor(m_urlRequestInterceptor.get());
+ connect(otr.get(), &WebEngineProfile::downloadRequested, m_downloadManager.get(), &DownloadsWidget::addDownload);
m_profiles.insert("", otr);
// set default profile
@@ -73,41 +75,6 @@ void Browser::loadProfiles()
#endif
}
-/*
-std::shared_ptr<BookmarksWidget> &Browser::bookmarks()
-{
- Q_ASSERT(m_bookmarksManager);
- return m_bookmarksManager;
-}
-
-std::shared_ptr<DownloadsWidget> &Browser::downloads()
-{
- Q_ASSERT(m_downloadManager);
- return m_downloadManager;
-}
-
-BlockerManager *Browser::blocklists()
-{
- if(!m_blocklistManager) {
- m_blocklistManager = new BlockerManager();
- }
- return m_blocklistManager;
-}
-
-MainWindow *Browser::activeWindow()
-{
- if(m_windows.empty()) {
- return nullptr;
- }
-
- for(auto it = m_windows.cbegin(); it != m_windows.cend(); it++) {
- if(it->data()->isActiveWindow()) {
- return it->data();
- }
- }
- return m_windows.first().data();
-}*/
-
MainWindow *Browser::createWindow()
{
// the window will delete itself when it closes, so we don't need to delete it