mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
When downloading some file from empty tab, it will be closed imediately,
not when you actually start downloading
This commit is contained in:
parent
f24b6fcc21
commit
08fb0bec2b
@ -95,8 +95,8 @@ DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, QString
|
||||
m_downloadPage = webPage->mainFrame()->url();
|
||||
else if (webPage->history()->canGoBack())
|
||||
m_downloadPage = webPage->history()->backItem().url();
|
||||
else if (webPage->history()->count() == 0)
|
||||
webPage->getView()->closeTab();
|
||||
// else if (webPage->history()->count() == 0)
|
||||
// webPage->getView()->closeTab();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "qtwin.h"
|
||||
#include "desktopnotificationsfactory.h"
|
||||
#include "globalfunctions.h"
|
||||
#include "webpage.h"
|
||||
|
||||
DownloadManager::DownloadManager(QWidget* parent) :
|
||||
QWidget(parent)
|
||||
@ -173,6 +174,13 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, bool askWha
|
||||
m_hfileIcon = m_iconProvider->icon(tempInfo).pixmap(30,30);
|
||||
QString mimeType = m_iconProvider->type(tempInfo);
|
||||
|
||||
//Get Download Page and Close Empty Tab
|
||||
QNetworkRequest request = m_hreply->request();
|
||||
QVariant v = request.attribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100));
|
||||
WebPage* webPage = (WebPage*)(v.value<void*>());
|
||||
if (webPage && webPage->mainFrame()->url().isEmpty() && !webPage->history()->canGoBack() && webPage->history()->count() == 0)
|
||||
webPage->getView()->closeTab();
|
||||
|
||||
if (askWhatToDo) {
|
||||
DownloadOptionsDialog* dialog = new DownloadOptionsDialog(m_h_fileName, m_hfileIcon, mimeType, reply->url(), mApp->activeWindow());
|
||||
dialog->show();
|
||||
|
Loading…
Reference in New Issue
Block a user