From 5d5b94b1cdc13cb65c3431db05751c03161c5a9f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 13 Sep 2022 00:50:49 +0200 Subject: [PATCH] Use natural sort order for file names to import --- gtk2_ardour/sfdb_ui.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 5088efacea..8b4f750670 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -55,6 +55,7 @@ #include "pbd/tokenizer.h" #include "pbd/enumwriter.h" #include "pbd/file_utils.h" +#include "pbd/natsort.h" #include "pbd/pthread_utils.h" #include "pbd/string_convert.h" #include "pbd/xml++.h" @@ -1440,7 +1441,13 @@ SoundFileBrowser::get_paths () vector filenames = chooser.get_filenames(); vector::iterator i; - std::map im; + struct SortByName { + bool operator() (std::string const& a, std::string const& b) const { + return PBD::naturally_less (a.c_str (), b.c_str ()); + } + }; + + std::map im; for (i = filenames.begin(); i != filenames.end(); ++i) { GStatBuf buf;