Merge pull request #2595 from igrechuhin/ig-master

[ios] Updated map downloader event processing.
This commit is contained in:
Vlad Mihaylenko 2016-03-29 13:08:55 +04:00
commit 2c4d0da85f

View file

@ -141,22 +141,17 @@ using namespace storage;
for (MWMMapDownloaderTableViewCell * cell in self.tableView.visibleCells)
[cell processCountryEvent:countryId];
auto process = ^
BOOL needReload = NO;
auto const & s = GetFramework().Storage();
s.ForEachInSubtree(self.parentCountryId.UTF8String,
[&needReload, &countryId](TCountryId const & descendantId, bool groupNode)
{
needReload = needReload || countryId == descendantId;
});
if (needReload)
{
[self configAllMapsView];
[self reloadData];
};
if (countryId == self.parentCountryId.UTF8String)
{
process();
}
else
{
TCountriesVec childrenId;
GetFramework().Storage().GetChildren(self.parentCountryId.UTF8String, childrenId);
if (find(childrenId.cbegin(), childrenId.cend(), countryId) != childrenId.cend())
process();
}
}