13
0

Use g_rename instead of PBD::sys::rename in Session::rename_state

git-svn-id: svn://localhost/ardour2/branches/3.0@12874 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2012-06-23 05:08:40 +00:00
parent 8c831bef10
commit 4cd73d8165

View File

@ -655,17 +655,12 @@ Session::rename_state (string old_name, string new_name)
const string old_xml_filename = legalize_for_path (old_name) + statefile_suffix;
const string new_xml_filename = legalize_for_path (new_name) + statefile_suffix;
const sys::path old_xml_path(Glib::build_filename (_session_dir->root_path(), old_xml_filename));
const sys::path new_xml_path(Glib::build_filename (_session_dir->root_path(), new_xml_filename));
const std::string old_xml_path(Glib::build_filename (_session_dir->root_path(), old_xml_filename));
const std::string new_xml_path(Glib::build_filename (_session_dir->root_path(), new_xml_filename));
try
{
sys::rename (old_xml_path, new_xml_path);
}
catch (const sys::filesystem_error& err)
{
if (::g_rename (old_xml_path.c_str(), new_xml_path.c_str()) != 0) {
error << string_compose(_("could not rename snapshot %1 to %2 (%3)"),
old_name, new_name, err.what()) << endmsg;
old_name, new_name, g_strerror(errno)) << endmsg;
}
}