summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-08-04 19:32:38 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-08-04 19:32:38 +0000
commite62f14e707e15df962952f571dec1179b1c6976c (patch)
treec7a9595556d5ab5834aa14c542a48ac0e323f7fb /libs/ardour/session_state.cc
parent02a5c4088b79b830bec23827acd934c2e58bbcf3 (diff)
avoid multiple backups of 0.99 session state
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2244 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index e14c1c3779..1f8a4e1fbe 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -814,13 +814,17 @@ Session::load_state (string 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)
- << endmsg;
+ /* don't make another copy if it already exists */
- copy_file (xmlpath, backup_path);
-
- /* if it fails, don't worry. right? */
+ if (!Glib::file_test (backup_path, Glib::FILE_TEST_EXISTS)) {
+ info << string_compose (_("Copying old session file %1 to %2\nUse %2 with Ardour versions before 2.0 from now on"),
+ xmlpath, backup_path)
+ << endmsg;
+
+ copy_file (xmlpath, backup_path);
+
+ /* if it fails, don't worry. right? */
+ }
}
return 0;