summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2007-09-04 04:48:36 +0000
committerTim Mayberry <mojofunk@gmail.com>2007-09-04 04:48:36 +0000
commitdd51b6a6b8bc4128c94624b078237bc30d360583 (patch)
treed170d94e7ec6286348d1c94b9ae657693719a778 /libs
parent8058475a3d7017a553bf4553ebe158d1f6bf594b (diff)
Use ARDOUR::create_backup_file in Session::remove_state
git-svn-id: svn://localhost/ardour2/trunk@2383 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_state.cc20
1 files changed, 5 insertions, 15 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index ad4473bd87..758c2b609a 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -63,6 +63,7 @@
#include <ardour/session.h>
#include <ardour/session_directory.h>
#include <ardour/session_utils.h>
+#include <ardour/session_state_utils.h>
#include <ardour/buffer.h>
#include <ardour/audio_diskstream.h>
#include <ardour/midi_diskstream.h>
@@ -548,21 +549,10 @@ Session::remove_state (string snapshot_name)
xml_path /= snapshot_name + statefile_suffix;
- sys::path backup_path(xml_path.to_string() + backup_suffix);
-
- // make a backup copy of the state file
- if (sys::exists (xml_path)) {
- try
- {
- sys::copy_file (xml_path, backup_path);
- }
- catch(sys::filesystem_error& ex)
- {
- error << string_compose (_("Not removing state file %1 because a backup could not be made (%2)"),
- xml_path.to_string(), ex.what())
- << endmsg;
- return;
- }
+ if (!create_backup_file (xml_path)) {
+ // don't remove it if a backup can't be made
+ // create_backup_file will log the error.
+ return;
}
// and delete it