different name for old-session-format copied file, so that 0.99 can always load it
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 23 Apr 2007 14:30:40 +0000 (14:30 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 23 Apr 2007 14:30:40 +0000 (14:30 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1740 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_state.cc

index 418709a82647007a56a838aab429d142b38b28aa..efd2d180f284232d59dced08d0225ff5e802dd5f 100644 (file)
@@ -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;
                }
        }