notify the user if a promoted snapshot will overwrite something in the global snapshots list

This commit is contained in:
Nikolaus Gullotta 2019-08-15 10:40:27 -05:00 committed by Nikolaus Gullotta
parent 4a085b91f5
commit bb9b4119e2
No known key found for this signature in database
GPG key ID: 565F60578092AA31
3 changed files with 87 additions and 32 deletions

View file

@ -107,10 +107,12 @@ bool MixerSnapshotManager::promote(MixerSnapshot* snapshot) {
const string path = snapshot->get_path();
if(Glib::file_test(path.c_str(), Glib::FILE_TEST_EXISTS)) {
const string label = snapshot->get_label();
//write out this snapshot to the global path
snapshot->write(_global_path);
//that might've overwritten a file, erase it's reference
const string label = snapshot->get_label();
MixerSnapshot* old_snapshot = get_snapshot_by_name(label, true);
set<MixerSnapshot*>::iterator iter = _global_snapshots.find(old_snapshot);
if(iter != _global_snapshots.end()) {