parent
7c833ce764
commit
f3693d819d
|
@ -13,7 +13,7 @@ import "qrc:/qml/menu"
|
|||
import "qrc:/js/util.js" as Util
|
||||
|
||||
Item {
|
||||
property alias listModel: roomListProxyModel.sourceModel
|
||||
property alias listModel: sortedRoomListModel.sourceModel
|
||||
property int filter: 0
|
||||
property var enteredRoom: null
|
||||
|
||||
|
@ -50,27 +50,8 @@ Item {
|
|||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: roomListProxyModel
|
||||
id: sortedRoomListModel
|
||||
|
||||
filters: [
|
||||
RegExpFilter {
|
||||
roleName: "name"
|
||||
pattern: searchField.text
|
||||
caseSensitivity: Qt.CaseInsensitive
|
||||
},
|
||||
ExpressionFilter {
|
||||
enabled: filter === 1
|
||||
expression: unreadCount > 0
|
||||
},
|
||||
ExpressionFilter {
|
||||
enabled: filter === 2
|
||||
expression: category === 1 || category === 2 || category === 4
|
||||
},
|
||||
ExpressionFilter {
|
||||
enabled: filter === 3
|
||||
expression: category === 3 || category === 5
|
||||
}
|
||||
]
|
||||
proxyRoles: ExpressionRole {
|
||||
name: "display"
|
||||
expression: {
|
||||
|
@ -93,6 +74,36 @@ Item {
|
|||
]
|
||||
}
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: roomListProxyModel
|
||||
|
||||
sourceModel: sortedRoomListModel
|
||||
|
||||
filters: [
|
||||
RegExpFilter {
|
||||
roleName: "name"
|
||||
pattern: searchField.text
|
||||
caseSensitivity: Qt.CaseInsensitive
|
||||
},
|
||||
ExpressionFilter {
|
||||
enabled: filter === 1
|
||||
expression: unreadCount > 0
|
||||
},
|
||||
IndexFilter {
|
||||
enabled: filter === 1
|
||||
maximumIndex: 16
|
||||
},
|
||||
ExpressionFilter {
|
||||
enabled: filter === 2
|
||||
expression: category === 1 || category === 2 || category === 4
|
||||
},
|
||||
ExpressionFilter {
|
||||
enabled: filter === 3
|
||||
expression: category === 3 || category === 5
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
ListView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
|
Loading…
Reference in New Issue