Begin yet another model refactor
Use native ListModel which require a lot of changes, but should be much faster than the old way which exponentially slowed down to a crawl. Also fix some popup bugs (leave/forget). Not working yet: side pane keyboard controls, proper highlight, room & member filtering, local echo replacement
This commit is contained in:
@@ -172,7 +172,7 @@ HRowLayout {
|
||||
|
||||
HRepeater {
|
||||
id: linksRepeater
|
||||
model: eventDelegate.currentModel.links
|
||||
model: JSON.parse(eventDelegate.currentModel.links)
|
||||
|
||||
EventMediaLoader {
|
||||
singleMediaInfo: eventDelegate.currentModel
|
||||
|
@@ -3,6 +3,7 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import Clipboard 0.1
|
||||
import "../../.."
|
||||
import "../../../Base"
|
||||
|
||||
HColumnLayout {
|
||||
@@ -65,13 +66,8 @@ HColumnLayout {
|
||||
function json() {
|
||||
return JSON.stringify(
|
||||
{
|
||||
"model": utils.getItem(
|
||||
modelSources[[
|
||||
"Event", chat.userId, chat.roomId
|
||||
]],
|
||||
"client_id",
|
||||
model.client_id
|
||||
),
|
||||
"model": ModelStore.get(chat.userId, chat.roomId, "events")
|
||||
.get(model.id),
|
||||
"source": py.getattr(model.source, "__dict__"),
|
||||
},
|
||||
null, 4)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
import QtQuick 2.12
|
||||
import "../../.."
|
||||
import "../../../Base"
|
||||
|
||||
Rectangle {
|
||||
@@ -157,12 +158,12 @@ Rectangle {
|
||||
}
|
||||
|
||||
|
||||
model: HListModel {
|
||||
keyField: "client_id"
|
||||
source: modelSources[[
|
||||
"Event", chat.userId, chat.roomId
|
||||
]] || []
|
||||
}
|
||||
model: ModelStore.get(chat.userId, chat.roomId, "events")
|
||||
// model: HSortFilterProxy {
|
||||
// model: ModelStore.get(chat.userId, chat.roomId, "events")
|
||||
// comparator: "date"
|
||||
// descendingSort: true
|
||||
// }
|
||||
|
||||
delegate: EventDelegate {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user