Changeset View
Changeset View
Standalone View
Standalone View
src/lib/downloads/downloadmanager.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 124 | auto testWebView = [](TabbedWebView *view, const QUrl &url) { | |||
---|---|---|---|---|---|
137 | } | 137 | } | ||
138 | QUrl tabUrl = page->requestedUrl(); | 138 | QUrl tabUrl = page->requestedUrl(); | ||
139 | if (tabUrl.isEmpty()) { | 139 | if (tabUrl.isEmpty()) { | ||
140 | tabUrl = QUrl(view->webTab()->locationBar()->text()); | 140 | tabUrl = QUrl(view->webTab()->locationBar()->text()); | ||
141 | } | 141 | } | ||
142 | return tabUrl.host() == url.host(); | 142 | return tabUrl.host() == url.host(); | ||
143 | }; | 143 | }; | ||
144 | 144 | | |||
145 | if (testWebView(mApp->getWindow()->weView(), url)) { | 145 | BrowserWindow* mainWindow = mApp->getWindow(); | ||
146 | mApp->getWindow()->weView()->closeView(); | 146 | // If the main window was closed, there is no need to go further | ||
147 | if (mainWindow == nullptr) { | ||||
148 | return; | ||||
149 | } | ||||
150 | | ||||
151 | if (testWebView(mainWindow->weView(), url)) { | ||||
152 | mainWindow->weView()->closeView(); | ||||
147 | return; | 153 | return; | ||
148 | } | 154 | } | ||
149 | 155 | | |||
150 | const auto windows = mApp->windows(); | 156 | const auto windows = mApp->windows(); | ||
151 | for (auto *window : windows) { | 157 | for (auto *window : windows) { | ||
152 | const auto tabs = window->tabWidget()->allTabs(); | 158 | const auto tabs = window->tabWidget()->allTabs(); | ||
153 | for (auto *tab : tabs) { | 159 | for (auto *tab : tabs) { | ||
154 | auto *view = tab->webView(); | 160 | auto *view = tab->webView(); | ||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |