summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2012-06-23 05:07:42 +0000
committerTim Mayberry <mojofunk@gmail.com>2012-06-23 05:07:42 +0000
commit2f507c8a764d4647385c16e7a12be276422b2a7a (patch)
treec46b4ca2a6b56ef00a08d67fcd034b3f8b514924 /libs/ardour/session_state.cc
parent4363a6920f0340be4416d79b290f0696eae6c667 (diff)
Use giomm in PBD::sys::copy_file and change function signature
now returns bool to indicate successful copy rather than throw and takes strings as args git-svn-id: svn://localhost/ardour2/branches/3.0@12850 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index c03be469cb..7107ebee50 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -539,8 +539,7 @@ Session::create (const string& session_template, BusProfile* bus_profile)
_is_new = false;
/* Copy plugin state files from template to new session */
- sys::path template_plugins = session_template;
- template_plugins /= X_("plugins");
+ std::string template_plugins = Glib::build_filename (session_template, X_("plugins"));
sys::copy_files (template_plugins, plugins_dir ());
return 0;
@@ -944,14 +943,7 @@ Session::load_state (string snapshot_name)
xmlpath.to_string(), backup_path.to_string(), PROGRAM_NAME)
<< endmsg;
- try {
- sys::copy_file (xmlpath, backup_path);
-
- } catch (sys::filesystem_error& ex) {
-
- error << string_compose (_("Unable to make backup of state file %1 (%2)"),
- xmlpath.to_string(), ex.what())
- << endmsg;
+ if (!sys::copy_file (xmlpath.to_string(), backup_path.to_string())) {;
return -1;
}
}
@@ -2077,7 +2069,7 @@ Session::save_template (string template_name)
sys::path template_plugin_state_path = template_dir_path;
template_plugin_state_path /= X_("plugins");
sys::create_directories (template_plugin_state_path);
- sys::copy_files (plugins_dir(), template_plugin_state_path);
+ sys::copy_files (plugins_dir(), template_plugin_state_path.to_string());
return 0;
}