when saving an unnamed session, rename it

Note that this is done at the GUI level, might need to double check if there are
other paths into a "save" that should be covered. Control surfaces use the action, but
Lua comes to mind
This commit is contained in:
Paul Davis 2020-03-24 14:10:14 -06:00
parent e9be6c23a8
commit 5f1d802307
2 changed files with 5 additions and 5 deletions

View File

@ -243,7 +243,7 @@ public:
bool cannot_save () const { return _state_of_the_state & CannotSave; }
bool in_cleanup () const { return _state_of_the_state & InCleanup; }
bool inital_connect_or_deletion_in_progress () { return _state_of_the_state & (InitialConnecting | Deletion); }
bool not_named() const;
bool unnamed() const;
PBD::Signal0<void> DirtyChanged;

View File

@ -950,9 +950,6 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
remove_pending_capture_state ();
}
/* remove unnamed file name, if any (it's not an error if it doesn't exist */
::g_unlink (unnamed_file_name().c_str());
return 0;
}
@ -4535,6 +4532,9 @@ Session::rename (const std::string& new_name)
store_recent_sessions (new_name, _path);
/* remove unnamed file name, if any (it's not an error if it doesn't exist) */
::g_unlink (unnamed_file_name().c_str());
return 0;
}
@ -5657,7 +5657,7 @@ Session::unnamed_file_name() const
}
bool
Session::not_named() const
Session::unnamed() const
{
return Glib::file_test (unnamed_file_name(), Glib::FILE_TEST_EXISTS);
}