summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-10-04 03:35:53 +0200
committerRobin Gareus <robin@gareus.org>2018-10-04 03:36:14 +0200
commit59b789d2bbd14012755215d72affb96696024367 (patch)
tree687a6691bdaad562624a148218fc74cd158919c3
parentb6b353d4528bbb7f352f9947015a3b7168825a9c (diff)
Sort Session templates alphabetically
-rw-r--r--libs/ardour/ardour/template_utils.h5
-rw-r--r--libs/ardour/template_utils.cc1
2 files changed, 6 insertions, 0 deletions
diff --git a/libs/ardour/ardour/template_utils.h b/libs/ardour/ardour/template_utils.h
index f556e2c068..a865e87210 100644
--- a/libs/ardour/ardour/template_utils.h
+++ b/libs/ardour/ardour/template_utils.h
@@ -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);
diff --git a/libs/ardour/template_utils.cc b/libs/ardour/template_utils.cc
index f6b6c59fbc..4b8d5b2b78 100644
--- a/libs/ardour/template_utils.cc
+++ b/libs/ardour/template_utils.cc
@@ -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