From c6354259a866169dd5d7f6877c531e3a37637908 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 27 Jan 2017 10:28:32 +0100 Subject: [PATCH] DownloadManager: Improve logic for closeDownloadTab It now can handle also new tabs opened in background --- src/lib/downloads/downloadmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 2885b96e8..cb8e44a54 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -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(); };