1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +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) {
return false;
}
if (page->url() != QUrl() || page->requestedUrl() != QUrl()) {
if (page->url() != QUrl()) {
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();
};