Don't try to chop of the file name extension from a template dir
authorJohannes Mueller <github@johannes-mueller.org>
Sun, 2 Jul 2017 22:27:18 +0000 (00:27 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 12 Jul 2017 14:15:03 +0000 (16:15 +0200)
Template files reside in
.config/ardour5/templates/$(template_name)/$(template_name).template

We run through .config/ardour5/templates/ and find there the names of the
directories the .template-files are located in. These directory names don't
have a .template extension. So we shouldn't try to chop the non existing
extension of, because then we only modify template names with a '.' in them.

libs/ardour/template_utils.cc

index b2fa703060b7ca56e3473dd51184d14d6f023ab1..81a7f31078c5a377d0ea2a6188cff9b4d5a53fc9 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <glibmm.h>
 
-#include "pbd/basename.h"
 #include "pbd/file_utils.h"
 #include "pbd/stl_delete.h"
 #include "pbd/xml++.h"
@@ -104,7 +103,7 @@ find_session_templates (vector<TemplateInfo>& template_names, bool read_xml)
 
                TemplateInfo rti;
 
-               rti.name = basename_nosuffix (*i);
+               rti.name = Glib::path_get_basename (*i);
                rti.path = *i;
 
                template_names.push_back (rti);