Make "Filter members" work again

This commit is contained in:
miruka 2020-02-12 08:15:54 -04:00
parent 9a0969adf5
commit ae780345e8
3 changed files with 9 additions and 23 deletions

View File

@ -1,6 +1,5 @@
# TODO # TODO
- members filtering
- when inviting members, prevent if user id is on another server and room - when inviting members, prevent if user id is on another server and room
doesn't allow that doesn't allow that
- "exception during sync" aren't caught - "exception during sync" aren't caught

View File

@ -2,6 +2,7 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import SortFilterProxyModel 0.2
import "../../.." import "../../.."
import "../../../Base" import "../../../Base"
@ -10,26 +11,15 @@ HColumnLayout {
id: memberList id: memberList
clip: true clip: true
model: ModelStore.get(chat.userId, chat.roomId, "members") model: SortFilterProxyModel {
// model: HSortFilterProxy { sourceModel: ModelStore.get(chat.userId, chat.roomId, "members")
// model: ModelStore.get(chat.userId, chat.roomId, "members")
// comparator: (a, b) => filters: ExpressionFilter {
// // Sort by power level, then by display name or user ID (no @) expression: utils.filterMatches(
// [ filterField.text, model.display_name,
// a.invited, )
// b.power_level, }
// (a.display_name || a.id.substring(1)).toLocaleLowerCase(), }
// ] < [
// b.invited,
// a.power_level,
// (b.display_name || b.id.substring(1)).toLocaleLowerCase(),
// ]
// filter: (item, index) => utils.filterMatchesAny(
// filterField.text, item.display_name, item.id,
// )
// }
delegate: MemberDelegate { delegate: MemberDelegate {
width: memberList.width width: memberList.width
@ -53,8 +43,6 @@ HColumnLayout {
bordered: false bordered: false
opacity: width >= 16 * theme.uiScale ? 1 : 0 opacity: width >= 16 * theme.uiScale ? 1 : 0
onTextChanged: memberList.model.reFilter()
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true

View File

@ -83,7 +83,6 @@ QtObject {
function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){ function onModelItemFieldChanged(syncId, oldIndex, newIndex, field, value){
print("change", syncId, oldIndex, newIndex, field, value)
const model = ModelStore.get(syncId) const model = ModelStore.get(syncId)
model.setProperty(oldIndex, field, value) model.setProperty(oldIndex, field, value)