13
0

Save template description at toplevel rather than in <Metadata/>

This commit is contained in:
Johannes Mueller 2017-08-19 00:04:07 +02:00 committed by Robin Gareus
parent e933db1a12
commit 908369ab3e
2 changed files with 8 additions and 16 deletions

View File

@ -256,15 +256,10 @@ TemplateManager::save_template_desc ()
return;
}
XMLNode* md = tree.root()->child (X_("Metadata"));
if (!md) {
md = new XMLNode (X_("Metadata"));
tree.root()->add_child_nocopy (*md);
}
XMLNode* desc = md->child (X_("description"));
XMLNode* desc = tree.root()->child (X_("description"));
if (!desc) {
desc = new XMLNode (X_("description"));
md->add_child_nocopy (*desc);
tree.root()->add_child_nocopy (*desc);
}
XMLNode* dn = new XMLNode (X_("content"), desc_txt);
desc->add_child_nocopy (*dn);

View File

@ -113,13 +113,10 @@ find_session_templates (vector<TemplateInfo>& template_names, bool read_xml)
}
string description = "No Description";
XMLNode *md = tree.root()->child("Metadata");
if (md != 0) {
XMLNode *desc = md->child("description");
XMLNode *desc = tree.root()->child("description");
if (desc != 0) {
description = desc->attribute_value();
}
}
rti.created_with = created_with;
rti.description = description;