diff options
author | Ilya Grechuhin <i.grechuhin@gmail.com> | 2018-02-21 14:23:11 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-03-05 12:02:52 +0300 |
commit | b16a1df1ef636e4c03e380f8c7eb5e80245e9516 (patch) | |
tree | a395adcc99484386baf3b78875a92567548ff044 | |
parent | 837fdace0e72fb884f1403d1018dc65fd87d157b (diff) |
[release-81-fixes] [ios] Fixed autoupdate status update.
-rw-r--r-- | iphone/Maps/UI/Autoupdate/MWMAutoupdateController.mm | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/iphone/Maps/UI/Autoupdate/MWMAutoupdateController.mm b/iphone/Maps/UI/Autoupdate/MWMAutoupdateController.mm index 5238e085e5..84b40948c9 100644 --- a/iphone/Maps/UI/Autoupdate/MWMAutoupdateController.mm +++ b/iphone/Maps/UI/Autoupdate/MWMAutoupdateController.mm @@ -235,6 +235,18 @@ enum class State } completion:nil]; } +- (void)updateProcessStatus:(TCountryId const &)countryId +{ + auto const & s = GetFramework().GetStorage(); + NodeAttrs nodeAttrs; + s.GetNodeAttrs(RootId(), nodeAttrs); + auto view = static_cast<MWMAutoupdateView *>(self.view); + NSString * nodeName = @(s.GetNodeLocalName(countryId).c_str()); + [view setStatusForNodeName:nodeName rootAttributes:nodeAttrs]; + if (nodeAttrs.m_downloadingProgress.first == nodeAttrs.m_downloadingProgress.second) + self.progressFinished = YES; +} + #pragma mark - MWMCircularProgressProtocol - (void)progressButtonPressed:(MWMCircularProgress *)progress { [self cancel]; } @@ -265,6 +277,8 @@ enum class State if (self.progressFinished && m_updatingCountries.empty()) [self dismiss]; + else + [self updateProcessStatus:countryId]; } - (void)processError @@ -294,16 +308,8 @@ enum class State - (void)processCountry:(TCountryId const &)countryId progress:(MapFilesDownloader::TProgress const &)progress { - if (m_updatingCountries.find(countryId) == m_updatingCountries.end()) - return; - auto const & s = GetFramework().GetStorage(); - NodeAttrs nodeAttrs; - s.GetNodeAttrs(RootId(), nodeAttrs); - auto view = static_cast<MWMAutoupdateView *>(self.view); - NSString * nodeName = @(s.GetNodeLocalName(countryId).c_str()); - [view setStatusForNodeName:nodeName rootAttributes:nodeAttrs]; - if (nodeAttrs.m_downloadingProgress.first == nodeAttrs.m_downloadingProgress.second) - self.progressFinished = YES; + if (m_updatingCountries.find(countryId) != m_updatingCountries.end()) + [self updateProcessStatus:countryId]; } @end |