Browse Source

Reverted File::compareFilenames() method to not compare filenames naturally and added an optional argument to use a natural comparison

tags/2021-05-28
ed 9 years ago
parent
commit
d6fc589b6d
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      modules/juce_core/files/juce_File.cpp

+ 3
- 3
modules/juce_core/files/juce_File.cpp View File

@@ -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
}


Loading…
Cancel
Save