| 2075 | } |
| 2076 | |
| 2077 | void Storage::CancelDownloadNode(CountryId const & countryId) |
| 2078 | { |
| 2079 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 2080 | |
| 2081 | LOG(LINFO, ("Cancelling the downloading of", countryId)); |
| 2082 | |
| 2083 | auto const setQueue = GetQueuedCountries(m_downloader->GetQueue()); |
| 2084 | |
| 2085 | ForEachInSubtree(countryId, [&](CountryId const & descendantId, bool /* groupNode */) |
| 2086 | { |
| 2087 | auto needNotify = false; |
| 2088 | if (setQueue.count(descendantId) != 0) |
| 2089 | needNotify = DeleteCountryFilesFromDownloader(descendantId); |
| 2090 | |
| 2091 | if (m_failedCountries.erase(descendantId) != 0) |
| 2092 | needNotify = true; |
| 2093 | |
| 2094 | m_downloadingCountries.erase(countryId); |
| 2095 | |
| 2096 | if (needNotify) |
| 2097 | NotifyStatusChangedForHierarchy(descendantId); |
| 2098 | }); |
| 2099 | } |
| 2100 | |
| 2101 | void Storage::RetryDownloadNode(CountryId const & countryId) |
| 2102 | { |