diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-09 10:10:44 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-09 10:10:44 -0400 |
commit | 7364ca213ae531870e198752661f2bbe1fbe8d9a (patch) | |
tree | 76db8fd33964c0a0782ced5b217e1f69bcb0e2a4 /libs/ardour/session_state.cc | |
parent | 0e5d86a82536deca0937159cbfa0dd28580633bb (diff) |
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
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 21088227d5..4e99c663f0 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3111,6 +3111,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; } @@ -3127,10 +3132,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)) |