mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 13:45:43 +01:00
do not attempt to save undo history if it is empty, and do not do any part of history save if we're not going to write a new file
This commit is contained in:
parent
a097b65db5
commit
a0fdeed441
1 changed files with 5 additions and 4 deletions
|
|
@ -3135,6 +3135,11 @@ Session::save_history (string snapshot_name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!Config->get_save_history() || Config->get_saved_history_depth() < 0 ||
|
||||
(_history.undo_depth() == 0 && _history.redo_depth() == 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (snapshot_name.empty()) {
|
||||
snapshot_name = _current_snapshot_name;
|
||||
}
|
||||
|
|
@ -3151,10 +3156,6 @@ Session::save_history (string snapshot_name)
|
|||
}
|
||||
}
|
||||
|
||||
if (!Config->get_save_history() || Config->get_saved_history_depth() < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
tree.set_root (&_history.get_state (Config->get_saved_history_depth()));
|
||||
|
||||
if (!tree.write (xml_path))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue