summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/DownloadManager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp
index 73d979e..b508723 100644
--- a/src/DownloadManager.cpp
+++ b/src/DownloadManager.cpp
@@ -2,9 +2,11 @@
void DownloadManager::downloadFile(QString& filename)
{
+ QUrl u = this->baseUrl.resolved(filename);
+ this->request.setUrl(u);
this->filename = filename;
this->reply = this->qnam->get(this->request);
- qiod = reply;
+ this->qiod = reply;
QObject::connect(this->reply, SIGNAL(finished()), this, SLOT(saveData()));
}
@@ -16,7 +18,7 @@ void DownloadManager::saveData()
qDebug() << "Couldnt open file! exiting...";
exit(1);
}
- outfile.write(this->reply->readAll());
+ outfile.write(this->qiod->readAll());
outfile.close();
}
@@ -34,7 +36,6 @@ void DownloadManager::print()
DownloadManager::DownloadManager()
{
this->qnam = new QNetworkAccessManager();
- this->request.setUrl(baseUrl);
}
DownloadManager::~DownloadManager()