From 59b789d2bbd14012755215d72affb96696024367 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 4 Oct 2018 03:35:53 +0200 Subject: Sort Session templates alphabetically --- libs/ardour/ardour/template_utils.h | 5 +++++ libs/ardour/template_utils.cc | 1 + 2 files changed, 6 insertions(+) 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 #include +#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& 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& template_names, bool read_xml) template_names.push_back (rti); } + std::sort(template_names.begin(), template_names.end()); } void -- cgit v1.2.3