1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

DownloadManager: Improve logic for closeDownloadTab

It now can handle also new tabs opened in background
This commit is contained in:
David Rosca 2017-01-27 10:28:32 +01:00
parent e10294db6d
commit c6354259a8

View File

@ -128,10 +128,13 @@ void DownloadManager::closeDownloadTab(const QUrl &url) const
if (page->history()->count() != 0) { if (page->history()->count() != 0) {
return false; return false;
} }
if (page->url() != QUrl() || page->requestedUrl() != QUrl()) { if (page->url() != QUrl()) {
return false; return false;
} }
const QUrl tabUrl(view->webTab()->locationBar()->text()); QUrl tabUrl = page->requestedUrl();
if (tabUrl.isEmpty()) {
tabUrl = QUrl(view->webTab()->locationBar()->text());
}
return tabUrl.host() == url.host(); return tabUrl.host() == url.host();
}; };