diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2012-06-23 05:09:31 +0000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2012-06-23 05:09:31 +0000 |
commit | 831251963c34587663419282f1cf98c691ea826d (patch) | |
tree | 6bf6297695361f23f19be479ee40f273dcbddc37 /libs | |
parent | 1dadaf3e059f1a7819cb9ffab79c0367ef0eecec (diff) |
Use std::string and Glib::build_filename in Session::save_state
git-svn-id: svn://localhost/ardour2/branches/3.0@12896 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/session_state.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index b70c640197..7474ce510e 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -801,28 +801,27 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot xml_path = Glib::build_filename (xml_path, legalize_for_path (snapshot_name) + pending_suffix); } - sys::path tmp_path(_session_dir->root_path()); + std::string tmp_path(_session_dir->root_path()); + tmp_path = Glib::build_filename (tmp_path, legalize_for_path (snapshot_name) + temp_suffix); - tmp_path /= legalize_for_path (snapshot_name) + temp_suffix; + // cerr << "actually writing state to " << xml_path << endl; - // cerr << "actually writing state to " << xml_path.to_string() << endl; - - if (!tree.write (tmp_path.to_string())) { - error << string_compose (_("state could not be saved to %1"), tmp_path.to_string()) << endmsg; - if (g_remove (tmp_path.to_string().c_str()) != 0) { + if (!tree.write (tmp_path)) { + error << string_compose (_("state could not be saved to %1"), tmp_path) << endmsg; + if (g_remove (tmp_path.c_str()) != 0) { error << string_compose(_("Could not remove temporary state file at path \"%1\" (%2)"), - tmp_path.to_string(), g_strerror (errno)) << endmsg; + tmp_path, g_strerror (errno)) << endmsg; } return -1; } else { - if (::rename (tmp_path.to_string().c_str(), xml_path.c_str()) != 0) { + if (::rename (tmp_path.c_str(), xml_path.c_str()) != 0) { error << string_compose (_("could not rename temporary session file %1 to %2"), - tmp_path.to_string(), xml_path) << endmsg; - if (g_remove (tmp_path.to_string().c_str()) != 0) { + tmp_path, xml_path) << endmsg; + if (g_remove (tmp_path.c_str()) != 0) { error << string_compose(_("Could not remove temporary state file at path \"%1\" (%2)"), - tmp_path.to_string(), g_strerror (errno)) << endmsg; + tmp_path, g_strerror (errno)) << endmsg; } return -1; } |