diff --git a/src/Config.h b/src/Config.h index e6cab893..d1963c0a 100644 --- a/src/Config.h +++ b/src/Config.h @@ -34,7 +34,7 @@ #define VER_LAMEXP_MINOR_LO 8 #define VER_LAMEXP_TYPE RC #define VER_LAMEXP_PATCH 2 -#define VER_LAMEXP_BUILD 1332 +#define VER_LAMEXP_BUILD 1333 #define VER_LAMEXP_CONFG 1288 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Global.cpp b/src/Global.cpp index ce886cf1..e761a328 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -2436,12 +2436,20 @@ static bool lamexp_natural_string_sort_helper(const QString &str1, const QString return (strnatcmp(QWCHAR(str1), QWCHAR(str2)) < 0); } +/* + * Natural Order String Comparison - the 'lessThan' helper function *with* case folding + */ +static bool lamexp_natural_string_sort_helper_fold_case(const QString &str1, const QString &str2) +{ + return (strnatcasecmp(QWCHAR(str1), QWCHAR(str2)) < 0); +} + /* * Natural Order String Comparison - the main sorting function */ -void lamexp_natural_string_sort(QStringList &list) +void lamexp_natural_string_sort(QStringList &list, const bool bIgnoreCase) { - qSort(list.begin(), list.end(), lamexp_natural_string_sort_helper); + qSort(list.begin(), list.end(), bIgnoreCase ? lamexp_natural_string_sort_helper_fold_case : lamexp_natural_string_sort_helper); } /* diff --git a/src/Global.h b/src/Global.h index 9624501d..d0f22c7a 100644 --- a/src/Global.h +++ b/src/Global.h @@ -162,7 +162,7 @@ const QString lamexp_clean_filepath(const QString &str); void lamexp_seed_rand(void); unsigned int lamexp_rand(void); QDate lamexp_current_date_safe(void); -void lamexp_natural_string_sort(QStringList &list); +void lamexp_natural_string_sort(QStringList &list, const bool bIgnoreCase); void lamexp_fatal_exit(const wchar_t* exitMessage, const wchar_t* errorBoxMessage = NULL); //Debug-only functions diff --git a/src/Thread_FileAnalyzer.cpp b/src/Thread_FileAnalyzer.cpp index 1f12f53e..81b6efd6 100644 --- a/src/Thread_FileAnalyzer.cpp +++ b/src/Thread_FileAnalyzer.cpp @@ -119,7 +119,7 @@ void FileAnalyzer::run() emit progressMaxChanged(nFiles); emit progressValChanged(0); - lamexp_natural_string_sort(m_inputFiles); //.sort(); + lamexp_natural_string_sort(m_inputFiles, true); //.sort(); if(!m_templateFile) {