| 170 | } |
| 171 | |
| 172 | void Screenshoter::ProcessNextKml() |
| 173 | { |
| 174 | std::string const postfix = "_" + languages::GetCurrentNorm(); |
| 175 | std::unique_ptr<kml::FileData> kmlData; |
| 176 | while (kmlData == nullptr && !m_filesToProcess.empty()) |
| 177 | { |
| 178 | auto const filePath = m_filesToProcess.front(); |
| 179 | m_filesToProcess.pop_front(); |
| 180 | m_nextScreenshotName = base::GetNameFromFullPathWithoutExt(filePath) + postfix; |
| 181 | |
| 182 | ChangeState(State::LoadKml); |
| 183 | kmlData = LoadKmlFile(filePath, KmlFileType::Text); |
| 184 | if (kmlData != nullptr && kmlData->m_bookmarksData.empty() && kmlData->m_tracksData.empty()) |
| 185 | kmlData.reset(); |
| 186 | } |
| 187 | |
| 188 | if (kmlData == nullptr) |
| 189 | { |
| 190 | ChangeState(State::Done); |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | kmlData->m_categoryData.m_visible = true; |
| 195 | |
| 196 | BookmarkManager::KMLDataCollection collection; |
| 197 | collection.emplace_back("", std::move(kmlData)); |
| 198 | |
| 199 | auto & bookmarkManager = m_framework.GetBookmarkManager(); |
| 200 | auto es = bookmarkManager.GetEditSession(); |
| 201 | auto const idList = bookmarkManager.GetUnsortedBmGroupsIdList(); |
| 202 | for (auto catId : idList) |
| 203 | es.DeleteBmCategory(catId, true); |
| 204 | |
| 205 | bookmarkManager.CreateCategories(std::move(collection)); |
| 206 | |
| 207 | ChangeState(State::WaitPosition); |
| 208 | auto const newCatId = bookmarkManager.GetUnsortedBmGroupsIdList().front(); |
| 209 | m_framework.ShowBookmarkCategory(newCatId, false); |
| 210 | WaitPosition(); |
| 211 | } |
| 212 | |
| 213 | void Screenshoter::ProcessNextRect() |
| 214 | { |
nothing calls this directly
no test coverage detected