From fcd492ff2db588d06d5272b4382fc9caacc2cc97 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 7 Jul 2019 22:25:30 -0400 Subject: [PATCH] Fix room categories sorting --- TODO.md | 1 - src/qml/Models/RoomCategories.qml | 9 ++++++++- src/qml/SidePane/RoomCategoriesList.qml | 6 ------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index 150fffd1..19350ee5 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,4 @@ - room doesn't change category when accept/reject invite -- forget doesn't delete - "rejoin" leftbanner button if room is public - daybreak color diff --git a/src/qml/Models/RoomCategories.qml b/src/qml/Models/RoomCategories.qml index 34799f47..21f786a6 100644 --- a/src/qml/Models/RoomCategories.qml +++ b/src/qml/Models/RoomCategories.qml @@ -1,4 +1,11 @@ import QtQuick 2.7 +import SortFilterProxyModel 0.2 import "../Base" -HListModel {} +HListModel { + sorters: [ + FilterSorter { ValueFilter { roleName: "name"; value: "Invites" } }, + FilterSorter { ValueFilter { roleName: "name"; value: "Rooms" } }, + FilterSorter { ValueFilter { roleName: "name"; value: "Left" } } + ] +} diff --git a/src/qml/SidePane/RoomCategoriesList.qml b/src/qml/SidePane/RoomCategoriesList.qml index bda8af24..624db118 100644 --- a/src/qml/SidePane/RoomCategoriesList.qml +++ b/src/qml/SidePane/RoomCategoriesList.qml @@ -14,12 +14,6 @@ HListView { roleName: "userId" value: userId } - - sorters: FilterSorter { - ValueFilter { roleName: "name"; value: "Invites" } - ValueFilter { roleName: "name"; value: "Rooms" } - ValueFilter { roleName: "name"; value: "Left" } - } } delegate: RoomCategoryDelegate {}