mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 20:55:48 +01:00
extend session-save dirty-flag logic
Snapshot and continue working on current session incorrectly marks the session as clean.
This commit is contained in:
parent
23b975e172
commit
f53dc5945e
1 changed files with 15 additions and 4 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue