From 1ee42e89edac9078fe60f57c11b6953ee3861654 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Tue, 1 Mar 2016 17:08:36 +0300 Subject: [PATCH] [ios] Fixed downloader section header update. --- .../DataSources/MWMMapDownloaderDefaultDataSource.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm index f0d2e7026a..dc996a83e1 100644 --- a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm +++ b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm @@ -82,7 +82,7 @@ using namespace storage; self.needFullReload = (hadDownloadedCountries != self.haveDownloadedCountries || countryIds.count == 0); if (self.needFullReload) return; - if (hadDownloadedCountries && ![downloadedCoutryIds isEqualToArray:self.downloadedCoutryIds]) + if (hadDownloadedCountries || ![downloadedCoutryIds isEqualToArray:self.downloadedCoutryIds]) m_reloadSections.push_back(self.downloadedCountrySection); [countryIds enumerateKeysAndObjectsUsingBlock:^(NSString * key, NSArray * obj, BOOL * stop) { @@ -174,7 +174,10 @@ using namespace storage; { NodeAttrs nodeAttrs; GetFramework().Storage().GetNodeAttrs(m_parentId, nodeAttrs); - return [NSString stringWithFormat:@"%@ (%@)", L(@"downloader_downloaded"), formattedSize(nodeAttrs.m_localMwmSize)]; + if (nodeAttrs.m_localMwmSize == 0) + return [NSString stringWithFormat:@"%@", L(@"downloader_downloaded")]; + else + return [NSString stringWithFormat:@"%@ (%@)", L(@"downloader_downloaded"), formattedSize(nodeAttrs.m_localMwmSize)]; } return self.indexes[section - self.countrySectionsShift]; }