Clarify new session dirty state

New unnamed sessions need to remain dirty so that the GUI
asks to save or delete the session.
This commit is contained in:
Robin Gareus
2024-08-01 23:26:57 +02:00
parent 2a5b5a8b0e
commit 5d02970de8
2 changed files with 11 additions and 7 deletions

View File

@@ -509,17 +509,12 @@ Session::Session (AudioEngine &eng,
}
bool was_dirty = dirty();
unset_dirty ();
PresentationInfo::Change.connect_same_thread (*this, boost::bind (&Session::notify_presentation_info_change, this, _1));
Config->ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, false));
config.ParameterChanged.connect_same_thread (*this, boost::bind (&Session::config_changed, this, _1, true));
if (was_dirty) {
DirtyChanged (); /* EMIT SIGNAL */
}
StartTimeChanged.connect_same_thread (*this, boost::bind (&Session::start_time_changed, this, _1));
EndTimeChanged.connect_same_thread (*this, boost::bind (&Session::end_time_changed, this, _1));
@@ -553,7 +548,18 @@ Session::Session (AudioEngine &eng,
_is_new = true;
}
/* unsets dirty flag */
session_loaded ();
if (_is_new && unnamed) {
set_dirty ();
was_dirty = false;
}
if (was_dirty) {
DirtyChanged (); /* EMIT SIGNAL */
}
_is_new = false;
if (need_template_resave) {

View File

@@ -407,8 +407,6 @@ Session::post_engine_init ()
/* Can't do this until the trigger input MIDI port is set up */
TriggerBox::static_init (*this);
set_clean ();
/* Now, finally, we can [ask the butler to] fill the playback buffers */
BootMessage (_("Filling playback buffers"));