Fixes #2002: Companion audio tracks not alphabetically sorted
This commit is contained in:
@@ -1020,3 +1020,8 @@ QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int ma
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
|
||||||
|
{
|
||||||
|
return s1.toLower() < s2.toLower();
|
||||||
|
}
|
||||||
|
|||||||
@@ -157,4 +157,6 @@ bool isTempFileName(const QString & fileName);
|
|||||||
QString getSoundsPath(const GeneralSettings &generalSettings);
|
QString getSoundsPath(const GeneralSettings &generalSettings);
|
||||||
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen);
|
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen);
|
||||||
|
|
||||||
|
bool caseInsensitiveLessThan(const QString &s1, const QString &s2);
|
||||||
|
|
||||||
#endif // HELPERS_H
|
#endif // HELPERS_H
|
||||||
|
|||||||
@@ -665,7 +665,10 @@ void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, c
|
|||||||
|
|
||||||
bool added = false;
|
bool added = false;
|
||||||
QString currentvalue(value);
|
QString currentvalue(value);
|
||||||
foreach (QString entry, paramsList) {
|
// Convert set into list and sort it alphabetically case insensitive
|
||||||
|
QStringList list = QStringList::fromSet(paramsList);
|
||||||
|
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||||
|
foreach (QString entry, list) {
|
||||||
b->addItem(entry);
|
b->addItem(entry);
|
||||||
if (entry==currentvalue) {
|
if (entry==currentvalue) {
|
||||||
b->setCurrentIndex(b->count()-1);
|
b->setCurrentIndex(b->count()-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user