Improve the sorting of the effects list

Sort by:
* category
 ** exclusive group
  *** name

Thus we have an alphabetic order of all categories, in the categories
we have again an alphabetic order of all effects in the same group and
the effects in one group are listed at the bottom of the category.

REVIEW: 116753
This commit is contained in:
Martin Gräßlin 2014-03-12 09:22:47 +01:00
parent 8573bb6bed
commit 38e18a1d4c

View file

@ -204,6 +204,12 @@ void EffectModel::loadEffects()
} }
qSort(m_effectsList.begin(), m_effectsList.end(), [](const EffectData &a, const EffectData &b) { qSort(m_effectsList.begin(), m_effectsList.end(), [](const EffectData &a, const EffectData &b) {
if (a.category == b.category) {
if (a.exclusiveGroup == b.exclusiveGroup) {
return a.name < b.name;
}
return a.exclusiveGroup < b.exclusiveGroup;
}
return a.category < b.category; return a.category < b.category;
}); });