1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Showing file size of downloaded file in download options dialog.

This commit is contained in:
nowrep 2012-02-11 14:37:19 +01:00
parent 42d9e93363
commit 24ad0ffde7
2 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,11 @@ void DownloadFileHelper::handleUnsupportedContent(QNetworkReply* reply, bool ask
m_fileIcon = m_iconProvider->icon(tempInfo).pixmap(30, 30);
QString mimeType = m_iconProvider->type(tempInfo);
qint64 size = m_reply->header(QNetworkRequest::ContentLengthHeader).toLongLong();
if (size > 0) {
mimeType.append(QString(" (%1)").arg(DownloadItem::fileSizeToString(size)));
}
// Close Empty Tab
if (m_webPage) {
WebView* view = qobject_cast<WebView*>(m_webPage->view());

View File

@ -24,6 +24,7 @@ DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, const QPix
, m_signalEmited(false)
{
ui->setupUi(this);
ui->fileName->setText("<b>" + fileName + "</b>");
ui->fileIcon->setPixmap(fileIcon);
ui->fileType->setText(mimeType);