From ca14600965479dd3d255b734a0fe54bb2ba7892d Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Nov 2015 15:01:53 +0100 Subject: [PATCH] Use natural comparison also for the file types If we want to sort according to file types, we're also sorting user visible strings. For that we can also use the natural comparison collator, as file types should be case insensitive, and won't contain numbers. And even if they do a natual sorting will make it easier for the end user to find what they are looking for. Change-Id: Ie1d7d0af041a08be0f0d1a4eeb2eae9be885ffc7 Reviewed-by: Marc Mutz --- src/widgets/dialogs/qfilesystemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 1b9a1129b2..cfc6b9c4cc 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1024,7 +1024,7 @@ public: } case 2: { - int compare = QString::localeAwareCompare(l->type(), r->type()); + int compare = naturalCompare.compare(l->type(), r->type()); if (compare == 0) return naturalCompare.compare(l->fileName, r->fileName) < 0;