summaryrefslogtreecommitdiff
path: root/client/DownloadClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/DownloadClient.cpp')
-rw-r--r--client/DownloadClient.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/client/DownloadClient.cpp b/client/DownloadClient.cpp
index df4da25..b834622 100644
--- a/client/DownloadClient.cpp
+++ b/client/DownloadClient.cpp
@@ -19,7 +19,7 @@ void DownloadClient::Download(const string &filename)
pair<string, string> file(filename, 0);
vector<pair<string, string> > fileList;
fileList.push_back(file);
- Download(fileList);
+ Download(fileList);
}
void DownloadClient::Download(const pair<string, string> &file)
@@ -46,6 +46,28 @@ void DownloadClient::Download(const vector<pair<string, string> > &fileList)
DoDownload();
}
+void DownloadClient::DoDownload()
+{
+ if (currentId < (int)files.size())
+ {
+ currentId++;
+ pair<string, string> file = files[currentId];
+ QString filename = QString::fromLocal8Bit(file.first.c_str());
+ string md5 = file.second;
+ current = new QFile(filename);
+ current->open(QIODevice::ReadWrite);
+
+ Logger::Info("Downloading file %s\n", file.first.c_str());
+ SendFileRequest(file.first);
+ }
+ else
+ {
+ Logger::Info("All files have been downloaded.");
+ isDownloading = false;
+ emit downloadFinished();
+ }
+}
+
void DownloadClient::FileDataRecieved(SslClient::RequestType &type, QByteArray &data)
{
if (type != RegularFile)
@@ -86,25 +108,3 @@ void DownloadClient::FileDataRecieved(SslClient::RequestType &type, QByteArray &
DoDownload();
}
}
-
-void DownloadClient::DoDownload()
-{
- if (currentId < (int)files.size())
- {
- currentId++;
- pair<string, string> file = files[currentId];
- QString filename = QString::fromLocal8Bit(file.first.c_str());
- string md5 = file.second;
- current = new QFile(filename);
- current->open(QIODevice::ReadWrite);
-
- Logger::Info("Downloading file %s\n", file.first.c_str());
- SendFileRequest(file.first);
- }
- else
- {
- Logger::Info("All files have been downloaded.");
- isDownloading = false;
- emit downloadFinished();
- }
-}