fix(@desktop/chat): sort users by online status
Users model has to be sorted by online status first, otherwise `UserListPanel` sections will be duplicated. That's because: > Note: Adding sections to a ListView does not automatically re-order the list items by the section criteria. If the model is not ordered by section, then it is possible that the sections created will not be unique; each boundary between differing sections will result in a section header being created even if that section exists elsewhere. fixes: #6563
This commit is contained in:
parent
eeb77aeb51
commit
f9b3f91bf1
|
@ -54,10 +54,16 @@ Item {
|
||||||
|
|
||||||
model: SortFilterProxyModel {
|
model: SortFilterProxyModel {
|
||||||
sourceModel: usersModule.model
|
sourceModel: usersModule.model
|
||||||
sorters: StringSorter {
|
sorters: [
|
||||||
roleName: "displayName"
|
RoleSorter {
|
||||||
caseSensitivity: Qt.CaseInsensitive
|
roleName: "onlineStatus"
|
||||||
}
|
sortOrder: Qt.DescendingOrder
|
||||||
|
},
|
||||||
|
StringSorter {
|
||||||
|
roleName: "displayName"
|
||||||
|
caseSensitivity: Qt.CaseInsensitive
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
section.property: "onlineStatus"
|
section.property: "onlineStatus"
|
||||||
section.delegate: (root.width > 58) ? sectionDelegateComponent : null
|
section.delegate: (root.width > 58) ? sectionDelegateComponent : null
|
||||||
|
|
Loading…
Reference in New Issue