+ vector<string> templates;
+
+ find_paths_matching_filter (templates, template_search_path(), template_filter, 0, true, true);
+
+ if (templates.empty()) {
+ cerr << "Found nothing along " << template_search_path().to_string() << endl;
+ return;
+ }
+
+ cerr << "Found " << templates.size() << " along " << template_search_path().to_string() << endl;
+
+ for (vector<string>::iterator i = templates.begin(); i != templates.end(); ++i) {
+ string file = session_template_dir_to_file (*i);
+
+ TemplateInfo rti;
+ rti.name = Glib::path_get_basename (*i);
+ rti.path = *i;
+
+ if (read_xml) {
+
+ XMLTree tree;
+ if (!tree.read (file.c_str())) {
+ cerr << "Failed to parse Route-template XML file: " << file;
+ continue;
+ }
+
+ XMLNode* root = tree.root();
+
+ rti.modified_with = _("(unknown)");
+ try {
+ XMLNode *pv = root->child("ProgramVersion");
+ string modified_with;
+ if (pv != 0) {
+ pv->get_property (X_("modified-with"), modified_with);
+ }
+ rti.modified_with = modified_with;
+ } catch (XMLException &e) {}
+
+ rti.description = _("No Description");
+ try {
+ XMLNode *desc = root->child("description");
+ if (desc != 0) {
+ rti.description = desc->attribute_value();
+ }
+ } catch (XMLException &e) {}
+ }
+
+ template_names.push_back (rti);
+ }