From 5f1d802307c7e68ebc39ff4d4f4a534333f98f41 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 24 Mar 2020 14:10:14 -0600 Subject: 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 --- libs/ardour/ardour/session.h | 2 +- libs/ardour/session_state.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'libs') 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 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); } -- cgit v1.2.3