From 9f98837255da3de058dd3273655535c6b5d997f4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 12 Mar 2014 08:49:18 -0400 Subject: more error messages if session renaming fails, and remove stupid use of RENAME macro and use ::g_rename() instead --- libs/ardour/session_state.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libs') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 3e117f61d3..47971bf633 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3602,8 +3602,6 @@ Session::rename (const std::string& new_name) string const old_sources_root = _session_dir->sources_root(); -#define RENAME ::rename - /* Rename: * session directory @@ -3665,7 +3663,8 @@ Session::rename (const std::string& new_name) cerr << "Rename " << oldstr << " => " << newstr << endl; - if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) { + if (::g_rename (oldstr.c_str(), newstr.c_str()) != 0) { + error << string_compose (_("renaming %s as %2 failed (%3)"), oldstr, newstr, g_strerror (errno)) << endmsg; return 1; } @@ -3692,7 +3691,8 @@ Session::rename (const std::string& new_name) cerr << "Rename " << oldstr << " => " << newstr << endl; - if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) { + if (::g_rename (oldstr.c_str(), newstr.c_str()) != 0) { + error << string_compose (_("renaming %s as %2 failed (%3)"), oldstr, newstr, g_strerror (errno)) << endmsg; return 1; } } @@ -3704,7 +3704,8 @@ Session::rename (const std::string& new_name) cerr << "Rename " << oldstr << " => " << newstr << endl; - if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) { + if (::g_rename (oldstr.c_str(), newstr.c_str()) != 0) { + error << string_compose (_("renaming %s as %2 failed (%3)"), oldstr, newstr, g_strerror (errno)) << endmsg; return 1; } @@ -3718,7 +3719,8 @@ Session::rename (const std::string& new_name) cerr << "Rename " << oldstr << " => " << newstr << endl; - if (RENAME (oldstr.c_str(), newstr.c_str()) != 0) { + if (::g_rename (oldstr.c_str(), newstr.c_str()) != 0) { + error << string_compose (_("renaming %s as %2 failed (%3)"), oldstr, newstr, g_strerror (errno)) << endmsg; return 1; } } @@ -3754,8 +3756,6 @@ Session::rename (const std::string& new_name) store_recent_sessions (new_name, _path); return 0; - -#undef RENAME } int -- cgit v1.2.3