aboutsummaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-20 18:08:56 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-20 18:08:56 +0100
commit2abe26db203c75798775a42eae2d7dc7ab9bf354 (patch)
treecf273c92e1fdc68fcca90409bad160b4d7fe27e6 /src/browser.cpp
parentAdded SSL cert warnings (diff)
downloadsmolbote-2abe26db203c75798775a42eae2d7dc7ab9bf354.tar.xz
Bug fixes
.config/smolbote will now be created if missing Connected profiles to download manager Added missing license from WebPage
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