Fix testing for session files
The clause that was added in b65fe35f67 to allow passing
FQN including .ardour suffix on the comandline.
As side-effect this prevented loading sessions that were named
after a folder inside the session-bundle. e.g. "plugin" or
"interchage" or "dead" etc.
This commit is contained in:
@@ -983,7 +983,7 @@ Session::load_state (string snapshot_name, bool from_template)
|
|||||||
std::string xmlpath(_session_dir->root_path());
|
std::string xmlpath(_session_dir->root_path());
|
||||||
xmlpath = Glib::build_filename (xmlpath, legalize_for_path (snapshot_name + pending_suffix));
|
xmlpath = Glib::build_filename (xmlpath, legalize_for_path (snapshot_name + pending_suffix));
|
||||||
|
|
||||||
if (Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
|
if (Glib::file_test (xmlpath, Glib::FILE_TEST_IS_REGULAR)) {
|
||||||
|
|
||||||
/* there is pending state from a crashed capture attempt */
|
/* there is pending state from a crashed capture attempt */
|
||||||
|
|
||||||
@@ -999,9 +999,9 @@ Session::load_state (string snapshot_name, bool from_template)
|
|||||||
xmlpath = Glib::build_filename (_session_dir->root_path(), snapshot_name);
|
xmlpath = Glib::build_filename (_session_dir->root_path(), snapshot_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
|
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_IS_REGULAR)) {
|
||||||
xmlpath = Glib::build_filename (_session_dir->root_path(), legalize_for_path (snapshot_name + statefile_suffix));
|
xmlpath = Glib::build_filename (_session_dir->root_path(), legalize_for_path (snapshot_name + statefile_suffix));
|
||||||
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
|
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_IS_REGULAR)) {
|
||||||
error << string_compose(_("%1: session file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
|
error << string_compose(_("%1: session file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user