From d1fc7aa459df62fcf050ecd731db0e6bdc00c090 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 23 Jun 2012 05:08:26 +0000 Subject: [PATCH] Use Glib file utility functions in Session::remove_pending_capture_state git-svn-id: svn://localhost/ardour2/branches/3.0@12868 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_state.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 302d14fa0d..39a73d7006 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -51,6 +51,7 @@ #endif #include +#include #include #include @@ -627,18 +628,13 @@ Session::maybe_write_autosave() void Session::remove_pending_capture_state () { - sys::path pending_state_file_path(_session_dir->root_path()); + std::string pending_state_file_path(_session_dir->root_path()); - pending_state_file_path /= legalize_for_path (_current_snapshot_name) + pending_suffix; + pending_state_file_path = Glib::build_filename (pending_state_file_path, legalize_for_path (_current_snapshot_name) + pending_suffix); - try - { - sys::remove (pending_state_file_path); - } - catch(sys::filesystem_error& ex) - { - error << string_compose(_("Could remove pending capture state at path \"%1\" (%2)"), - pending_state_file_path.to_string(), ex.what()) << endmsg; + if (g_remove (pending_state_file_path.c_str()) != 0) { + error << string_compose(_("Could not remove pending capture state at path \"%1\" (%2)"), + pending_state_file_path, g_strerror (errno)) << endmsg; } }