From 4b21d8d5f40b2c695351fd10bd64f77476e1e83b Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 18 Nov 2015 16:50:49 -0300 Subject: [PATCH] Sort listbox items using compare_filenames() to compare numbers correctly (fix #782) --- src/ui/listbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/listbox.cpp b/src/ui/listbox.cpp index 6cbda29cd..f64cff71a 100644 --- a/src/ui/listbox.cpp +++ b/src/ui/listbox.cpp @@ -10,6 +10,7 @@ #include "ui/listbox.h" +#include "base/path.h" #include "ui/listitem.h" #include "ui/message.h" #include "ui/preferred_size_event.h" @@ -123,7 +124,7 @@ void ListBox::centerScroll() } inline bool sort_by_text(Widget* a, Widget* b) { - return a->getText() < b->getText(); + return (base::compare_filenames(a->getText(), b->getText()) < 0); } void ListBox::sortItems()