From 8dfd9a789c32cd35517ba926e3163e36f937d215 Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Thu, 9 Jan 2025 16:20:07 +0400 Subject: [PATCH] [map] show Track PP after TrackRecording saving Signed-off-by: Kiryl Kaveryn --- map/bookmark_manager.cpp | 6 ++++-- map/bookmark_manager.hpp | 2 +- map/framework.cpp | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index 5446b59378..6a49214cb0 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -1111,7 +1111,7 @@ kml::CompilationType BookmarkManager::GetCompilationType(kml::MarkGroupId id) co return compilation->second->GetCategoryData().m_type; } -void BookmarkManager::SaveTrackRecording(std::string trackName) +kml::TrackId BookmarkManager::SaveTrackRecording(std::string trackName) { CHECK_THREAD_CHECKER(m_threadChecker, ()); auto const & tracker = GpsTracker::Instance(); @@ -1153,7 +1153,9 @@ void BookmarkManager::SaveTrackRecording(std::string trackName) auto editSession = GetEditSession(); auto const track = editSession.CreateTrack(std::move(trackData)); auto const groupId = LastEditedBMCategory(); - AttachTrack(track->GetId(), groupId); + auto const trackId = track->GetId(); + AttachTrack(trackId, groupId); + return trackId; } std::string BookmarkManager::GenerateTrackRecordingName() const diff --git a/map/bookmark_manager.hpp b/map/bookmark_manager.hpp index 3e13c01611..788feafe62 100644 --- a/map/bookmark_manager.hpp +++ b/map/bookmark_manager.hpp @@ -432,7 +432,7 @@ public: bool IsCompilation(kml::MarkGroupId id) const; kml::CompilationType GetCompilationType(kml::MarkGroupId id) const; - void SaveTrackRecording(std::string trackName); + kml::TrackId SaveTrackRecording(std::string trackName); std::string GenerateTrackRecordingName() const; dp::Color GenerateTrackRecordingColor() const; diff --git a/map/framework.cpp b/map/framework.cpp index 8781e204e0..329b6d04d7 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1751,10 +1751,11 @@ void Framework::StopTrackRecording() void Framework::SaveTrackRecordingWithName(std::string const & name) { - GetBookmarkManager().SaveTrackRecording(name); - GpsTracker::Instance().Clear(); + auto const trackId = GetBookmarkManager().SaveTrackRecording(name); if (m_drapeEngine) m_drapeEngine->ClearGpsTrackPoints(); + ShowTrack(trackId); + GpsTracker::Instance().Clear(); } bool Framework::IsTrackRecordingEmpty() const