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:
parent
92ceaa948c
commit
471f68beb9
3 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue