diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-04-11 14:59:01 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-04-11 14:59:01 +0300 |
commit | 0b85de4d146ef93abaa3c176d371bf1f16a36d65 (patch) | |
tree | f249077d68fb7696b1ddb214380863a4423028c8 /qt | |
parent | da14a65bbda7a6361107a058278ec9b1c03a8cde (diff) |
[new downloader] Calculating map downloading progress in percentage in qt application.
Diffstat (limited to 'qt')
-rw-r--r-- | qt/draw_widget.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp index 23fc076c14..3988b3df26 100644 --- a/qt/draw_widget.cpp +++ b/qt/draw_widget.cpp @@ -123,21 +123,22 @@ void DrawWidget::UpdateCountryStatus(storage::TCountryId const & countryId) { if (m_currentCountryChanged != nullptr) { - // TODO @bykoianko string countryName = countryId; - uint8_t progress = 50; - auto status = m_framework->Storage().CountryStatusEx(countryId); - storage::TMwmSize sizeInBytes = 0; + uint8_t progressInPercentage = 0; + storage::MapFilesDownloader::TProgress progressInByte = make_pair(0, 0); if (!countryId.empty()) { storage::NodeAttrs nodeAttrs; m_framework->Storage().GetNodeAttrs(countryId, nodeAttrs); - sizeInBytes = nodeAttrs.m_mwmSize; + progressInByte = nodeAttrs.m_downloadingProgress; + if (progressInByte.second != 0) + progressInPercentage = static_cast<int8_t>(100 * progressInByte.first / progressInByte.second); } - m_currentCountryChanged(countryId, countryName, status, sizeInBytes, progress); + m_currentCountryChanged(countryId, countryName, status, + progressInByte.second, progressInPercentage); } } |