From 4ebea3867e782fd34ef7f76a86e2665595c59020 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 23 Apr 2007 14:30:40 +0000 Subject: [PATCH] different name for old-session-format copied file, so that 0.99 can always load it git-svn-id: svn://localhost/ardour2/trunk@1740 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_state.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 418709a826..efd2d180f2 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -751,7 +751,7 @@ Session::load_state (string snapshot_name) xmlpath += snapshot_name; xmlpath += _pending_suffix; - if (!access (xmlpath.c_str(), F_OK)) { + if (Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) { /* there is pending state from a crashed capture attempt */ @@ -766,8 +766,8 @@ Session::load_state (string snapshot_name) xmlpath += snapshot_name; xmlpath += _statefile_suffix; } - - if (access (xmlpath.c_str(), F_OK)) { + + if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) { error << string_compose(_("%1: session state information file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg; return 1; } @@ -809,8 +809,10 @@ Session::load_state (string snapshot_name) if (is_old) { string backup_path; - backup_path = xmlpath; - backup_path += ".1"; + backup_path = _path; + backup_path += snapshot_name; + backup_path += "-1"; + backup_path += _statefile_suffix; info << string_compose (_("Copying old session file %1 to %2\nUse %2 with Ardour versions before 2.0 from now on"), xmlpath, backup_path) @@ -1505,7 +1507,7 @@ Session::path_from_region_name (string name, string identifier) snprintf (buf, sizeof(buf), "%s/%s-%" PRIu32 ".wav", dir.c_str(), name.c_str(), n); } - if (!g_file_test (buf, G_FILE_TEST_EXISTS)) { + if (!Glib::file_test (buf, Glib::FILE_TEST_EXISTS)) { return buf; } } -- 2.30.2