mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Change MixerSnapshotManager::remove to use new erase method
This commit is contained in:
parent
bb0d10c2d4
commit
a6323e84f6
1 changed files with 10 additions and 21 deletions
|
|
@ -229,7 +229,7 @@ bool MixerSnapshotManager::rename(MixerSnapshot* snapshot, const string& new_nam
|
||||||
::g_remove(path.c_str());
|
::g_remove(path.c_str());
|
||||||
//remove the old file
|
//remove the old file
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -240,26 +240,15 @@ bool MixerSnapshotManager::remove(MixerSnapshot* snapshot) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const string path = snapshot->get_path();
|
const string path = snapshot->get_path();
|
||||||
const string dir = Glib::path_get_dirname(path);
|
if (Glib::file_test(path.c_str(), Glib::FILE_TEST_EXISTS)) {
|
||||||
|
if(erase(snapshot)) {
|
||||||
::g_remove(path.c_str());
|
::g_remove(path.c_str());
|
||||||
|
|
||||||
set<MixerSnapshot*>::iterator iter;
|
|
||||||
if(dir == _global_path) {
|
|
||||||
iter = _global_snapshots.find(snapshot);
|
|
||||||
if(iter != _global_snapshots.end()) {
|
|
||||||
delete (*iter);
|
|
||||||
_global_snapshots.erase(iter);
|
|
||||||
}
|
|
||||||
} else if(dir == _local_path) {
|
|
||||||
iter = _local_snapshots.find(snapshot);
|
|
||||||
if(iter != _local_snapshots.end()) {
|
|
||||||
delete (*iter);
|
|
||||||
_local_snapshots.erase(iter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RemovedSnapshot(); /* EMIT SIGNAL */
|
RemovedSnapshot(); /* EMIT SIGNAL */
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MixerSnapshot* MixerSnapshotManager::get_snapshot_by_name(const string& name, bool global)
|
MixerSnapshot* MixerSnapshotManager::get_snapshot_by_name(const string& name, bool global)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue