summaryrefslogtreecommitdiffstats
path: root/src/DownloadManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DownloadManager.cpp')
-rw-r--r--src/DownloadManager.cpp9
1 files changed, 5 insertions, 4 deletions
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();