From d6fc589b6da1ae27c3a9adfade39ae023ccb49ef Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 2 Dec 2016 16:18:15 +0000 Subject: [PATCH] Reverted File::compareFilenames() method to not compare filenames naturally and added an optional argument to use a natural comparison --- modules/juce_core/files/juce_File.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 9c2147f38d..6322ca74c6 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -226,12 +226,12 @@ bool File::areFileNamesCaseSensitive() #endif } -static int compareFilenames (const String& name1, const String& name2) noexcept +static int compareFilenames (const String& name1, const String& name2, bool shouldSortNaturally = false) noexcept { #if NAMES_ARE_CASE_SENSITIVE - return name1.compareNatural (name2, true); + return (shouldSortNaturally ? name1.compareNatural (name2, true) : name1.compare (name2)); #else - return name1.compareNatural (name2, false); + return (shouldSortNaturally ? name1.compareNatural (name2, false) : name1.compareIgnoreCase (name2)); #endif }