summaryrefslogtreecommitdiff
path: root/gtk2_ardour/template_dialog.cc
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2017-08-19 19:45:08 +0200
committerRobin Gareus <robin@gareus.org>2017-08-20 21:09:30 +0200
commitbd4db1e15139df141144310199b73c77d701c4b2 (patch)
tree49ed7331d6115d9bddcc4cd6a110423acfc299c9 /gtk2_ardour/template_dialog.cc
parent419b1c1cfdb2f6fee97312ab5b56a8579623534a (diff)
Remove the template description XMLNode before saving the template
... to avoid that the new template description is concatenated to the old one.
Diffstat (limited to 'gtk2_ardour/template_dialog.cc')
-rw-r--r--gtk2_ardour/template_dialog.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk2_ardour/template_dialog.cc b/gtk2_ardour/template_dialog.cc
index cce8d2eb3f..6002089aa6 100644
--- a/gtk2_ardour/template_dialog.cc
+++ b/gtk2_ardour/template_dialog.cc
@@ -256,14 +256,14 @@ TemplateManager::save_template_desc ()
return;
}
- XMLNode* desc = tree.root()->child (X_("description"));
- if (!desc) {
- desc = new XMLNode (X_("description"));
- tree.root()->add_child_nocopy (*desc);
- }
+ tree.root()->remove_nodes (X_("description"));
+ XMLNode* desc = new XMLNode (X_("description"));
+
XMLNode* dn = new XMLNode (X_("content"), desc_txt);
desc->add_child_nocopy (*dn);
+ tree.root()->add_child_nocopy (*desc);
+
if (!tree.write ()) {
error << string_compose(X_("Could not write to template file \"%1\"."), file_path) << endmsg;
return;