From bd4db1e15139df141144310199b73c77d701c4b2 Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Sat, 19 Aug 2017 19:45:08 +0200 Subject: Remove the template description XMLNode before saving the template ... to avoid that the new template description is concatenated to the old one. --- libs/ardour/route.cc | 1 + libs/ardour/session_state.cc | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'libs') diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 5cd9b576a5..e89b9b8b91 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -4022,6 +4022,7 @@ Route::save_as_template (const string& path, const string& name, const string& d XMLNode& node (state (false)); node.set_property (X_("name"), name); + node.remove_nodes (X_("description")); if (!description.empty()) { XMLNode* desc = new XMLNode(X_("description")); XMLNode* desc_cont = new XMLNode(X_("content"), description); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 0bf09f76c6..287822a6a6 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2414,12 +2414,13 @@ Session::save_template (const string& template_name, const string& description, XMLNode* root; { PBD::Unwinder uw (_template_state_dir, template_dir_path); - root = &get_template(); + root = &get_template (); } + root->remove_nodes (X_("description")); if (!description.empty()) { - XMLNode* desc = new XMLNode(X_("description")); - XMLNode* desc_cont = new XMLNode(X_("content"), description); + XMLNode* desc = new XMLNode (X_("description")); + XMLNode* desc_cont = new XMLNode (X_("content"), description); desc->add_child_nocopy (*desc_cont); root->add_child_nocopy (*desc); -- cgit v1.2.3