diff options
| author | Jonathan Bauer | 2011-02-22 13:21:52 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-02-22 13:21:52 +0100 |
| commit | 1fe27ccc2e6dd5a4f17ac28aefaf0332c821aef5 (patch) | |
| tree | 722c2f42149437bb376af89f7286c526c080b694 /src/DownloadManager.cpp | |
| parent | removed old test stuff... (diff) | |
| download | fbgui-1fe27ccc2e6dd5a4f17ac28aefaf0332c821aef5.tar.gz fbgui-1fe27ccc2e6dd5a4f17ac28aefaf0332c821aef5.tar.xz fbgui-1fe27ccc2e6dd5a4f17ac28aefaf0332c821aef5.zip | |
Code cleanup; few optimizations; download debug messages...
Diffstat (limited to 'src/DownloadManager.cpp')
| -rw-r--r-- | src/DownloadManager.cpp | 14 |
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() |
