| 1630 | } |
| 1631 | |
| 1632 | void Storage::DeleteNode(CountryId const & countryId) |
| 1633 | { |
| 1634 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 1635 | |
| 1636 | CountryTree::Node const * const node = m_countries.FindFirst(countryId); |
| 1637 | |
| 1638 | if (!node) |
| 1639 | return; |
| 1640 | |
| 1641 | auto const deleteAction = [this](CountryTree::Node const & descendantNode) |
| 1642 | { |
| 1643 | bool const onDisk = m_localFiles.find(descendantNode.Value().Name()) != m_localFiles.end(); |
| 1644 | if (descendantNode.ChildrenCount() == 0 && onDisk) |
| 1645 | DeleteCountry(descendantNode.Value().Name(), MapFileType::Map); |
| 1646 | }; |
| 1647 | node->ForEachInSubtree(deleteAction); |
| 1648 | } |
| 1649 | |
| 1650 | StatusAndError Storage::GetNodeStatus(CountryTree::Node const & node) const |
| 1651 | { |