MCPcopy Create free account
hub / github.com/comaps/comaps / ProcessNextKml

Method ProcessNextKml

qt/screenshoter.cpp:172–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void 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
213void Screenshoter::ProcessNextRect()
214{

Callers

nothing calls this directly

Calls 11

GetCurrentNormFunction · 0.85
LoadKmlFileFunction · 0.85
frontMethod · 0.80
GetEditSessionMethod · 0.80
DeleteBmCategoryMethod · 0.80
CreateCategoriesMethod · 0.80
ShowBookmarkCategoryMethod · 0.80
emptyMethod · 0.45
resetMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected