From 6712b04f22aa55717c32676be04bc2e0df40645b Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Sat, 5 Mar 2011 22:47:51 +0100 Subject: more random things... --- src/DownloadManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/DownloadManager.cpp') diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index 33c8952..d010490 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -35,10 +35,9 @@ void DownloadManager::startNextDownload() } // Dequeue next URL to download. QUrl url = dlQ.dequeue(); - QString tmp = url.path(); // Get filename from URL. - tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1); - outfile.setFileName(tmp); + QString tmp = url.path(); + outfile.setFileName(tmp.remove(0, tmp.lastIndexOf(QChar('/')) + 1)); // If error upon opening, skip this file. if (!outfile.open(QIODevice::WriteOnly)) @@ -50,6 +49,7 @@ void DownloadManager::startNextDownload() // Start the request for this URL. QNetworkRequest request(url); currentDownload = qnam->get(request); + // TODO: Error handling not working properly... if (currentDownload->error() != QNetworkReply::NoError) { qDebug() << "Network reply error, skipping download..."; @@ -88,7 +88,8 @@ void DownloadManager::downloadFinished() { // Second check if the download actually is finished. if (currentDownload->isFinished()) - qDebug() << "Downloaded " << currentDownload->url().toString() << endl; + qDebug() << "Download of " << currentDownload->url().toString() + << "finished." << endl; // Close output file. outfile.close(); currentDownload->deleteLater(); -- cgit v1.2.3-55-g7522