From bcba5bbdab43eced7ff64fc8b0ccb5daf507e82b Mon Sep 17 00:00:00 2001 From: Nikolaus Gullotta Date: Thu, 12 Sep 2019 13:58:19 -0500 Subject: [PATCH] Changes to MixerSnapshotManager::move MixerSnapshotManager::move will now correctly set the snapshot's path to the new path and correctly test for FILE_TEST_EXISTS when determining whether or not to bail early --- libs/ardour/mixer_snapshot_manager.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/ardour/mixer_snapshot_manager.cc b/libs/ardour/mixer_snapshot_manager.cc index 7e451e2deb..e88eb21cd2 100644 --- a/libs/ardour/mixer_snapshot_manager.cc +++ b/libs/ardour/mixer_snapshot_manager.cc @@ -150,8 +150,11 @@ bool MixerSnapshotManager::move(MixerSnapshot* snapshot, const string& to_path) if(Glib::file_test(path.c_str(), Glib::FILE_TEST_EXISTS)) { const string dir = Glib::path_get_dirname(path); + const string file = snapshot->get_label() + string(template_suffix); + const string new_path = Glib::build_filename(to_path, file); + //already there - if(to_path == dir) { + if (Glib::file_test(new_path.c_str(), Glib::FILE_TEST_EXISTS)) { return false; } @@ -161,6 +164,8 @@ bool MixerSnapshotManager::move(MixerSnapshot* snapshot, const string& to_path) } //write this to the new path snapshot->write(to_path); + + snapshot->set_path(new_path); return true; } return false;