diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-24 14:10:14 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-24 14:10:39 -0600 |
commit | 5f1d802307c7e68ebc39ff4d4f4a534333f98f41 (patch) | |
tree | 9371435df620e685d4f7ffc0c7cf3d7935564ba0 /libs | |
parent | e9be6c23a87e53b825357849576636bdb5e40787 (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 6b01d0c990..64b12fd0a0 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -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; diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index f82962ef3d..df4922a4ae 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -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); } |