[map] show Track PP after TrackRecording saving

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2025-01-09 16:20:07 +04:00 committed by Roman Tsisyk
parent 377d10de8c
commit 8dfd9a789c
3 changed files with 8 additions and 5 deletions

View file

@ -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

View file

@ -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;

View file

@ -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