Use PBD::sys::copy_file instead of PBD::copy_file in Session::remote_state

Replace one line C style comments with C++ equivalent in Session::remove_state


git-svn-id: svn://localhost/ardour2/trunk@2378 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry
2007-09-04 04:48:21 +00:00
parent 96c9b5456f
commit 4535b6ae84

View File

@@ -541,7 +541,7 @@ void
Session::remove_state (string snapshot_name)
{
if (snapshot_name == _current_snapshot_name || snapshot_name == _name) {
/* refuse to remove the current snapshot or the "main" one */
// refuse to remove the current snapshot or the "main" one
return;
}
@@ -551,12 +551,22 @@ Session::remove_state (string snapshot_name)
sys::path backup_path(xml_path.to_string() + backup_suffix);
/* make a backup copy of the state file */
// make a backup copy of the state file
if (sys::exists (xml_path)) {
copy_file (xml_path.to_string(), backup_path.to_string());
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;
}
}
/* and delete it */
// and delete it
sys::remove (xml_path);
}