| 2127 | } |
| 2128 | |
| 2129 | void BookmarkManager::ReloadBookmarkRoutine(std::string const & filePath) |
| 2130 | { |
| 2131 | GetPlatform().RunTask(Platform::Thread::File, [this, filePath]() |
| 2132 | { |
| 2133 | if (m_needTeardown) |
| 2134 | return; |
| 2135 | |
| 2136 | auto const ext = GetLowercaseFileExt(filePath); |
| 2137 | std::unique_ptr<kml::FileData> kmlData; |
| 2138 | if (ext == kKmlExtension) |
| 2139 | kmlData = LoadKmlFile(filePath, KmlFileType::Text); |
| 2140 | else if (ext == kGpxExtension) |
| 2141 | kmlData = LoadKmlFile(filePath, KmlFileType::Gpx); |
| 2142 | else |
| 2143 | ASSERT(false, ("Unsupported bookmarks extension", ext)); |
| 2144 | |
| 2145 | if (m_needTeardown) |
| 2146 | return; |
| 2147 | |
| 2148 | auto collection = std::make_shared<KMLDataCollection>(); |
| 2149 | if (kmlData) |
| 2150 | collection->emplace_back(std::move(filePath), std::move(kmlData)); |
| 2151 | |
| 2152 | if (m_needTeardown) |
| 2153 | return; |
| 2154 | |
| 2155 | NotifyAboutFinishAsyncLoading(std::move(collection)); |
| 2156 | }); |
| 2157 | } |
| 2158 | |
| 2159 | void BookmarkManager::NotifyAboutStartAsyncLoading() |
| 2160 | { |
nothing calls this directly
no test coverage detected