Improved ListModel and ListItem

- New ListItem implemented using a metaclass, which makes defining new
  ListItem subclasses much cleaner and shorter

- ListModel functions taking an index now accept either an int
  (list index) or str (value of a main key)

- getWhere() gone, simply use get(a_main_key_value) now

- updateOrAppendWhere replaced by update()/upsert()
This commit is contained in:
miruka
2019-04-29 23:51:37 -04:00
parent 216ae312c5
commit 012e89f6cb
7 changed files with 253 additions and 132 deletions

View File

@@ -8,7 +8,7 @@ HColumnLayout {
property string roomId: ""
readonly property var roomInfo:
Backend.models.rooms.get(userId).getWhere("roomId", roomId)
Backend.models.rooms.get(userId).get(roomId)
property bool canLoadPastEvents: true
@@ -17,7 +17,7 @@ HColumnLayout {
RoomHeader {
displayName: roomInfo.displayName
topic: roomInfo.topic
topic: roomInfo.topic || ""
}
RoomEventList {}