From 38e18a1d4c1fb57879a5b3d33ad15292f0a08883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 12 Mar 2014 09:22:47 +0100 Subject: [PATCH] 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 --- kcmkwin/kwincompositing/model.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kcmkwin/kwincompositing/model.cpp b/kcmkwin/kwincompositing/model.cpp index d04adeed31..1a36e5f5ec 100644 --- a/kcmkwin/kwincompositing/model.cpp +++ b/kcmkwin/kwincompositing/model.cpp @@ -204,6 +204,12 @@ void EffectModel::loadEffects() } 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; });