mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-11 16:06:25 +01:00
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
This commit is contained in:
parent
f428e51a8c
commit
bcba5bbdab
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue