1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 21:05:26 +03:00

Fixes #2002: Companion audio tracks not alphabetically sorted

This commit is contained in:
Damjan Adamic 2015-02-28 20:48:44 +01:00
parent 92ceaa948c
commit 471f68beb9
3 changed files with 11 additions and 1 deletions

View file

@ -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();
}

View file

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

View file

@ -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);