summaryrefslogtreecommitdiffstats
path: root/src/DownloadManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DownloadManager.cpp')
-rw-r--r--src/DownloadManager.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp
index b508723..436518f 100644
--- a/src/DownloadManager.cpp
+++ b/src/DownloadManager.cpp
@@ -5,8 +5,8 @@ void DownloadManager::downloadFile(QString& filename)
QUrl u = this->baseUrl.resolved(filename);
this->request.setUrl(u);
this->filename = filename;
+ qDebug() << "Downloading file: " << u.toString();
this->reply = this->qnam->get(this->request);
- this->qiod = reply;
QObject::connect(this->reply, SIGNAL(finished()), this, SLOT(saveData()));
}
@@ -18,14 +18,9 @@ void DownloadManager::saveData()
qDebug() << "Couldnt open file! exiting...";
exit(1);
}
- outfile.write(this->qiod->readAll());
+ outfile.write(this->reply->readAll());
outfile.close();
-
-}
-
-void DownloadManager::setUrl(QUrl& qurl)
-{
- this->baseUrl = qurl;
+ qDebug() << "Download done.";
}
void DownloadManager::print()
@@ -33,9 +28,10 @@ void DownloadManager::print()
qDebug() << "The download manager is still working";
}
-DownloadManager::DownloadManager()
+DownloadManager::DownloadManager(const QUrl& baseUrl)
{
this->qnam = new QNetworkAccessManager();
+ this->baseUrl = baseUrl;
}
DownloadManager::~DownloadManager()