Ignore case when sorting file names.
This commit is contained in:
parent
11268cd5b1
commit
8f77ee3b5f
@ -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
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user