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

Method SaveBookmarks

libs/map/bookmark_manager.cpp:3131–3155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3129}
3130
3131void BookmarkManager::SaveBookmarks(kml::GroupIdCollection const & groupIdCollection)
3132{
3133 CHECK_THREAD_CHECKER(m_threadChecker, ());
3134
3135 if (groupIdCollection.empty())
3136 return;
3137
3138 auto kmlDataCollection = PrepareToSaveBookmarks(groupIdCollection);
3139 if (!kmlDataCollection)
3140 return;
3141
3142 if (m_testModeEnabled)
3143 {
3144 // Save bookmarks synchronously.
3145 for (auto const & kmlItem : *kmlDataCollection)
3146 SaveKmlFileByExt(*kmlItem.second, kmlItem.first);
3147 return;
3148 }
3149
3150 GetPlatform().RunTask(Platform::Thread::File, [kmlDataCollection = std::move(kmlDataCollection)]()
3151 {
3152 for (auto const & kmlItem : *kmlDataCollection)
3153 SaveKmlFileByExt(*kmlItem.second, kmlItem.first);
3154 });
3155}
3156
3157void BookmarkManager::PrepareTrackFileForSharing(kml::TrackId trackId, SharingHandler && handler,
3158 KmlFileType kmlFileType)

Callers

nothing calls this directly

Calls 3

SaveKmlFileByExtFunction · 0.85
RunTaskMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected