diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-31 20:45:06 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-31 20:45:06 +0300 |
commit | 4b4002115d6c7b5c5113d1e2e6e9025565e1c9bb (patch) | |
tree | 4e4ecc6d26052bb5f50acd0c1a9260aceb5479fd /server/src/modules_handler.cpp | |
parent | 12eba4d75931c5e48dac70b1a7dbad7861d059df (diff) |
protocol:
download struct must have module_name field
server:
core:
implemented SERVER_DOWNLOADS_LIST_REPLY (draft)
added global downloads list
client:
using std::string instead of QString to avoid unnecessary conversions
Diffstat (limited to 'server/src/modules_handler.cpp')
-rw-r--r-- | server/src/modules_handler.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/src/modules_handler.cpp b/server/src/modules_handler.cpp index 6d351bb..eb08261 100644 --- a/server/src/modules_handler.cpp +++ b/server/src/modules_handler.cpp @@ -190,6 +190,22 @@ void modules_handler::on_modules_loaded() } } +void modules_handler::sync_downloads(std::map<int, download_internal_s> &downloads) +{ + int id = downloads.size(); + for(auto i : downloader_modules) + { + module_downloader *d = static_cast<module_downloader*>(i); + for(auto it : d->get_downloads()) + { + downloads[id].module_name = d->get_module_info().name; + downloads[id].core_id = id; //is it needed ? + downloads[id].module_id = it.id; + id++; + } + } +} + void modules_handler::load_modules_settings() { for(auto i : metadata_modules) |