1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

When downloading some file from empty tab, it will be closed imediately,

not when you actually start downloading
This commit is contained in:
nowrep 2011-09-23 15:40:14 +02:00
parent f24b6fcc21
commit 08fb0bec2b
2 changed files with 10 additions and 2 deletions

View File

@ -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();
}
}

View File

@ -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();