summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-10-16 20:54:15 +0200
committerRobin Gareus <robin@gareus.org>2015-10-16 20:54:15 +0200
commitf53dc5945e35fdbe246750787ccf2264ae74a9dd (patch)
tree76028d7e6beb0885429a07fdf8475d08234ffe58 /libs
parent23b975e1725960c28d1a564d8bd0cac0b001afb1 (diff)
extend session-save dirty-flag logic
Snapshot and continue working on current session incorrectly marks the session as clean.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_state.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index ddbe3771ac..3ccc4d606f 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -791,7 +791,14 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
SessionSaveUnderway (); /* EMIT SIGNAL */
+ bool mark_as_clean = true;
+
+ if (!snapshot_name.empty() && !switch_to_snapshot) {
+ mark_as_clean = false;
+ }
+
if (template_only) {
+ mark_as_clean = false;
tree.set_root (&get_template());
} else {
tree.set_root (&get_state());
@@ -803,6 +810,8 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
_current_snapshot_name = snapshot_name;
}
+ assert (!snapshot_name.empty());
+
if (!pending) {
/* proper save: use statefile_suffix (.ardour in English) */
@@ -854,12 +863,14 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
save_history (snapshot_name);
- bool was_dirty = dirty();
+ if (mark_as_clean) {
+ bool was_dirty = dirty();
- _state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
+ _state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
- if (was_dirty) {
- DirtyChanged (); /* EMIT SIGNAL */
+ if (was_dirty) {
+ DirtyChanged (); /* EMIT SIGNAL */
+ }
}
StateSaved (snapshot_name); /* EMIT SIGNAL */