Sort Session templates alphabetically
authorRobin Gareus <robin@gareus.org>
Thu, 4 Oct 2018 01:35:53 +0000 (03:35 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 4 Oct 2018 01:36:14 +0000 (03:36 +0200)
libs/ardour/ardour/template_utils.h
libs/ardour/template_utils.cc

index f556e2c068a7d67297b892f55a03236194d522cd..a865e8721047e85bf6eac12e1bf8d46384fcc7b5 100644 (file)
@@ -24,6 +24,7 @@
 #include <string>
 #include <vector>
 
+#include "ardour/utils.h"
 #include "ardour/libardour_visibility.h"
 
 namespace ARDOUR {
@@ -39,6 +40,10 @@ namespace ARDOUR {
                std::string path;
                std::string description;
                std::string modified_with;
+
+               bool operator < (const TemplateInfo& other) const {
+                       return cmp_nocase_utf8 (name, other.name) < 0;
+               }
        };
 
        LIBARDOUR_API void find_route_templates (std::vector<TemplateInfo>& template_names);
index f6b6c59fbce1967c74046c0677082a8802e937ea..4b8d5b2b7816b12f2e0f75ad11045ef1a9e3abc1 100644 (file)
@@ -131,6 +131,7 @@ find_session_templates (vector<TemplateInfo>& template_names, bool read_xml)
 
                template_names.push_back (rti);
        }
+       std::sort(template_names.begin(), template_names.end());
 }
 
 void