forked from organicmaps/organicmaps-tmp
Merge pull request #2595 from igrechuhin/ig-master
[ios] Updated map downloader event processing.
This commit is contained in:
commit
2c4d0da85f
1 changed files with 8 additions and 13 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue