From 4b4002115d6c7b5c5113d1e2e6e9025565e1c9bb Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 31 Aug 2015 20:45:06 +0300 Subject: 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 --- server/src/modules_handler.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'server/src/modules_handler.cpp') 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 &downloads) +{ + int id = downloads.size(); + for(auto i : downloader_modules) + { + module_downloader *d = static_cast(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) -- cgit v1.2.3