From cb6af94e1218626aec0a6919e3d2416f406b5c17 Mon Sep 17 00:00:00 2001 From: cyber-toad Date: Fri, 14 Feb 2025 23:49:15 +0100 Subject: [PATCH] [bookmarks] Remove unused code from BookmarkManager Signed-off-by: cyber-toad --- map/bookmark_manager.cpp | 63 ---------------------------------------- map/bookmark_manager.hpp | 6 ---- 2 files changed, 69 deletions(-) diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index 9f2a50836d..58e2bad73c 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -46,7 +45,6 @@ size_t const kMinCommonTypesCount = 3; double const kNearDistanceInMeters = 20 * 1000.0; double const kMyPositionTrackSnapInMeters = 20.0; -std::string const kKMLMimeType = "application/vnd.google-earth.kml+xml"; std::string const kKMZMimeType = "application/vnd.google-earth.kmz"; std::string const kGPXMimeType = "application/gpx+xml"; @@ -1002,15 +1000,6 @@ void BookmarkManager::DeleteTrackSelectionMark(kml::TrackId trackId) ResetTrackInfoMark(trackId); } -void BookmarkManager::SetTrackInfoMark(kml::TrackId trackId, m2::PointD const & pt) -{ - auto trackInfoMark = GetMarkForEdit(m_trackInfoMarkId); - trackInfoMark->SetPosition(pt); - auto const isVisible = IsVisible(GetTrack(trackId)->GetGroupId()); - trackInfoMark->SetIsVisible(isVisible); - trackInfoMark->SetTrackId(trackId); -} - void BookmarkManager::ResetTrackInfoMark(kml::TrackId trackId) { auto trackInfoMark = GetMarkForEdit(m_trackInfoMarkId); @@ -1856,12 +1845,6 @@ void BookmarkManager::InitRegionAddressGetter(DataSource const & dataSource, m_regionAddressGetter = std::make_unique(dataSource, infoGetter); } -void BookmarkManager::ResetRegionAddressGetter() -{ - std::unique_lock const lock(m_regionAddressMutex); - m_regionAddressGetter.reset(); -} - void BookmarkManager::UpdateViewport(ScreenBase const & screen) { m_viewport = screen; @@ -2031,23 +2014,6 @@ void BookmarkManager::LoadMetadata() m_metadata = metadata; } -void BookmarkManager::ClearCategories() -{ - CHECK_THREAD_CHECKER(m_threadChecker, ()); - for (auto groupId : m_unsortedBmGroupsIdList) - { - ClearGroup(groupId); - m_changesTracker.OnDeleteGroup(groupId); - } - - m_compilations.clear(); - m_categories.clear(); - m_unsortedBmGroupsIdList.clear(); - - m_bookmarks.clear(); - m_tracks.clear(); -} - BookmarkManager::KMLDataCollectionPtr BookmarkManager::LoadBookmarks( std::string const & dir, std::string_view ext, KmlFileType fileType, BookmarksChecker const & checker) @@ -3089,35 +3055,6 @@ void BookmarkManager::SetAllCategoriesVisibility(bool visible) } } -bool BookmarkManager::AreAllCompilationsVisible(kml::MarkGroupId categoryId, kml::CompilationType compilationType) const -{ - return CheckCompilationsVisibility(categoryId, compilationType, true); -} - -bool BookmarkManager::AreAllCompilationsInvisible(kml::MarkGroupId categoryId, kml::CompilationType compilationType) const -{ - return CheckCompilationsVisibility(categoryId, compilationType, false); -} - -bool BookmarkManager::CheckCompilationsVisibility(kml::MarkGroupId categoryId, kml::CompilationType compilationType, bool isVisible) const -{ - CHECK_THREAD_CHECKER(m_threadChecker, ()); - auto const categoryIt = m_categories.find(categoryId); - CHECK(categoryIt != m_categories.end(), ()); - auto & category = *categoryIt->second; - for (kml::MarkGroupId const compilationId : category.GetCategoryData().m_compilationIds) - { - auto const compilationIt = m_compilations.find(compilationId); - CHECK(compilationIt != m_compilations.cend(), ()); - auto & compilation = *compilationIt->second; - if (compilation.GetCategoryData().m_type != compilationType) - continue; - if (compilation.IsVisible() != isVisible) - return false; - } - return true; -} - void BookmarkManager::SetChildCategoriesVisibility(kml::MarkGroupId categoryId, kml::CompilationType compilationType, bool visible) { diff --git a/map/bookmark_manager.hpp b/map/bookmark_manager.hpp index 4847f69eee..b2e9adc467 100644 --- a/map/bookmark_manager.hpp +++ b/map/bookmark_manager.hpp @@ -179,7 +179,6 @@ public: void InitRegionAddressGetter(DataSource const & dataSource, storage::CountryInfoGetter const & infoGetter); - void ResetRegionAddressGetter(); void SetBookmarksChangedCallback(BookmarksChangedCallback && callback); void SetCategoriesChangedCallback(CategoriesChangedCallback && callback); @@ -364,8 +363,6 @@ public: bool AreAllCategoriesVisible() const; bool AreAllCategoriesInvisible() const; void SetAllCategoriesVisibility(bool visible); - bool AreAllCompilationsVisible(kml::MarkGroupId categoryId, kml::CompilationType compilationType) const; - bool AreAllCompilationsInvisible(kml::MarkGroupId categoryId, kml::CompilationType compilationType) const; void SetChildCategoriesVisibility(kml::MarkGroupId categoryId, kml::CompilationType compilationType, bool visible); @@ -596,7 +593,6 @@ private: void SetCategoryAccessRules(kml::MarkGroupId categoryId, kml::AccessRules accessRules); void SetCategoryCustomProperty(kml::MarkGroupId categoryId, std::string const & key, std::string const & value); bool DeleteBmCategory(kml::MarkGroupId groupId, bool permanently); - void ClearCategories(); void MoveBookmark(kml::MarkId bmID, kml::MarkGroupId curGroupID, kml::MarkGroupId newGroupID); void UpdateBookmark(kml::MarkId bmId, kml::BookmarkData const & bm); @@ -658,7 +654,6 @@ private: template void SetUniqueName(kml::CategoryData & data, UniquityChecker checker); bool CheckVisibility(bool isVisible) const; - bool CheckCompilationsVisibility(kml::MarkGroupId categoryId, kml::CompilationType compilationType, bool isVisible) const; struct SortBookmarkData { @@ -722,7 +717,6 @@ private: int GetTrackSelectionMarkMinZoom(kml::TrackId trackId) const; void SetTrackSelectionMark(kml::TrackId trackId, m2::PointD const & pt, double distance); void DeleteTrackSelectionMark(kml::TrackId trackId); - void SetTrackInfoMark(kml::TrackId trackId, m2::PointD const & pt); void ResetTrackInfoMark(kml::TrackId trackId); void UpdateTrackMarksMinZoom();