summaryrefslogtreecommitdiffstats
path: root/src/DownloadManager.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-05 22:47:51 +0100
committerJonathan Bauer2011-03-05 22:47:51 +0100
commit6712b04f22aa55717c32676be04bc2e0df40645b (patch)
tree9023e5e0bd61c59b5a2aabff156180ef7ec5d5a1 /src/DownloadManager.cpp
parentremoved some old comments (diff)
downloadfbgui-6712b04f22aa55717c32676be04bc2e0df40645b.tar.gz
fbgui-6712b04f22aa55717c32676be04bc2e0df40645b.tar.xz
fbgui-6712b04f22aa55717c32676be04bc2e0df40645b.zip
more random things...
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();