summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 3ccc4d606f..036e023dff 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -2102,7 +2102,7 @@ Session::XMLSourceFactory (const XMLNode& node)
}
int
-Session::save_template (string template_name)
+Session::save_template (string template_name, bool replace_existing)
{
if ((_state_of_the_state & CannotSave) || template_name.empty ()) {
return -1;
@@ -2128,10 +2128,10 @@ Session::save_template (string template_name)
}
if (!ARDOUR::Profile->get_trx()) {
- if (Glib::file_test (template_dir_path, Glib::FILE_TEST_EXISTS)) {
+ if (!replace_existing && Glib::file_test (template_dir_path, Glib::FILE_TEST_EXISTS)) {
warning << string_compose(_("Template \"%1\" already exists - new version not created"),
template_dir_path) << endmsg;
- return -1;
+ return -2;
}
if (g_mkdir_with_parents (template_dir_path.c_str(), 0755) != 0) {