diff --git a/gtk2_ardour/startup_fsm.cc b/gtk2_ardour/startup_fsm.cc index 46126a31a4..7601b6c206 100644 --- a/gtk2_ardour/startup_fsm.cc +++ b/gtk2_ardour/startup_fsm.cc @@ -556,13 +556,24 @@ StartupFSM::get_session_parameters_from_command_line (bool new_session_required) } bool -StartupFSM::get_session_parameters_from_path (string const & path, string const & template_name, bool new_session_required) +StartupFSM::get_session_parameters_from_path (string const & path_, string const & template_name, bool new_session_required) { - if (path.empty()) { + if (path_.empty()) { /* use GUI to ask the user */ return false; } + string path (path_); + + /* ... did the user give us a path or just a name? */ + + if (path.find (G_DIR_SEPARATOR) == string::npos) { + /* user gave session name with no path info, use + default session folder. + */ + path = Glib::build_filename (Config->get_default_session_parent_dir (), path); + } + if (Glib::file_test (path.c_str(), Glib::FILE_TEST_EXISTS)) { session_is_new = false; @@ -613,21 +624,10 @@ StartupFSM::get_session_parameters_from_path (string const & path, string const } - /* Everything after this involves a new session - * - * ... did the user give us a path or just a name? - */ + /* Everything after this involves a new session */ - if (path.find (G_DIR_SEPARATOR) == string::npos) { - /* user gave session name with no path info, use - default session folder. - */ - session_name = ARDOUR_COMMAND_LINE::session_name; - session_path = Glib::build_filename (Config->get_default_session_parent_dir (), session_name); - } else { - session_name = basename_nosuffix (path); - session_path = path; - } + session_name = basename_nosuffix (path); + session_path = path; session_template = string ();