From d070c785a00c5343130ce8a94ddf5a8cee43850e Mon Sep 17 00:00:00 2001 From: nowrep Date: Fri, 18 Mar 2011 23:04:02 +0100 Subject: [PATCH] Showing warning when mime data of download changes -> after some testing this function will be implemented --- src/downloads/downloaditem.cpp | 7 +++++++ src/downloads/downloaditem.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/downloads/downloaditem.cpp b/src/downloads/downloaditem.cpp index 19a983054..fbaf0ed2d 100644 --- a/src/downloads/downloaditem.cpp +++ b/src/downloads/downloaditem.cpp @@ -54,6 +54,7 @@ DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, QString connect(m_reply, SIGNAL(readyRead()), this, SLOT(readyRead())); connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError))); + connect(m_reply, SIGNAL(metaDataChanged()), this, SLOT(metaDataChanged())); connect(ui->button, SIGNAL(clicked(QPoint)), this, SLOT(stop())); m_downloading = true; @@ -69,6 +70,12 @@ DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, QString show(); } +void DownloadItem::metaDataChanged() +{ + QVariant locationHeader = m_reply->header(QNetworkRequest::LocationHeader); + QMessageBox::information(this, "Meta Data Changed", QString("Meta data changed feature unimplemented yet, sorry.\n URL: '%̈́'").arg(locationHeader.toUrl().toString())); +} + void DownloadItem::finished() { m_timer.stop(); diff --git a/src/downloads/downloaditem.h b/src/downloads/downloaditem.h index 5b2c650a0..85004f178 100644 --- a/src/downloads/downloaditem.h +++ b/src/downloads/downloaditem.h @@ -59,6 +59,7 @@ signals: private slots: void finished(); + void metaDataChanged(); void downloadProgress(qint64 received, qint64 total); void stop(); void openFile();