Move models to their own files
This commit is contained in:
@@ -9,7 +9,7 @@ Column {
|
||||
|
||||
// Avoid binding loop by using Component.onCompleted
|
||||
property var user: null
|
||||
Component.onCompleted: user = models.users.getUser(userId)
|
||||
Component.onCompleted: user = users.getUser(userId)
|
||||
|
||||
property string roomCategoriesListUserId: userId
|
||||
property bool expanded: true
|
||||
|
@@ -6,6 +6,6 @@ HListView {
|
||||
id: accountList
|
||||
clip: true
|
||||
|
||||
model: models.accounts
|
||||
model: accounts
|
||||
delegate: AccountDelegate {}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ HListView {
|
||||
id: roomCategoriesList
|
||||
|
||||
model: SortFilterProxyModel {
|
||||
sourceModel: models.roomCategories
|
||||
sourceModel: roomCategories
|
||||
filters: ValueFilter {
|
||||
roleName: "userId"
|
||||
value: userId
|
||||
|
@@ -37,11 +37,7 @@ MouseArea {
|
||||
}
|
||||
|
||||
HRichLabel {
|
||||
id: subtitleLabel
|
||||
visible: Boolean(text)
|
||||
textFormat: Text.StyledText
|
||||
text: {
|
||||
var ev = models.timelines.lastEventOf(model.roomId)
|
||||
function getText(ev) {
|
||||
if (! ev) { return "" }
|
||||
|
||||
if (! Utils.eventIsMessage(ev)) {
|
||||
@@ -49,11 +45,16 @@ MouseArea {
|
||||
}
|
||||
|
||||
return Utils.coloredNameHtml(
|
||||
models.users.getUser(ev.senderId).displayName,
|
||||
users.getUser(ev.senderId).displayName,
|
||||
ev.senderId
|
||||
) + ": " + py.callSync("inlinify", [ev.content])
|
||||
}
|
||||
|
||||
id: subtitleLabel
|
||||
visible: Boolean(text)
|
||||
textFormat: Text.StyledText
|
||||
text: getText(timelines.lastEventOf(model.roomId))
|
||||
|
||||
font.pixelSize: HStyle.fontSize.small
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
@@ -11,7 +11,7 @@ HListView {
|
||||
spacing: sidePane.normalSpacing
|
||||
|
||||
model: SortFilterProxyModel {
|
||||
sourceModel: models.rooms
|
||||
sourceModel: rooms
|
||||
filters: AllOf {
|
||||
ValueFilter {
|
||||
roleName: "category"
|
||||
|
Reference in New Issue
Block a user