Cleanup name handling in RoomListModel
Replace NameRole with DisplayNameRole entirely.
This commit is contained in:
@@ -18,7 +18,7 @@ ColumnLayout {
|
||||
spacing: 0
|
||||
MobileForm.FormComboBoxDelegate {
|
||||
text: i18n("Room")
|
||||
textRole: "name"
|
||||
textRole: "displayName"
|
||||
valueRole: "id"
|
||||
model: RoomListModel {
|
||||
id: roomListModel
|
||||
|
||||
@@ -90,7 +90,7 @@ QQC2.Dialog {
|
||||
id: roomListItem
|
||||
|
||||
required property var currentRoom
|
||||
required property string name
|
||||
required property string displayName
|
||||
required property int index
|
||||
required property int notificationCount
|
||||
required property string subtitleText
|
||||
@@ -114,7 +114,7 @@ QQC2.Dialog {
|
||||
root.close();
|
||||
}
|
||||
bold: roomListItem.notificationCount > 0
|
||||
label: roomListItem.name ?? ""
|
||||
label: roomListItem.displayName ?? ""
|
||||
labelItem.textFormat: Text.PlainText
|
||||
subtitle: roomListItem.subtitleText
|
||||
subtitleItem.textFormat: Text.PlainText
|
||||
@@ -124,7 +124,7 @@ QQC2.Dialog {
|
||||
|
||||
leading: Kirigami.Avatar {
|
||||
source: roomListItem.avatar ? "image://mxc/" + roomListItem.avatar : ""
|
||||
name: roomListItem.name || i18n("No Name")
|
||||
name: roomListItem.displayName
|
||||
implicitWidth: height
|
||||
sourceSize.width: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
||||
sourceSize.height: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
||||
|
||||
@@ -20,7 +20,7 @@ QQC2.ItemDelegate {
|
||||
required property bool categoryVisible
|
||||
required property string filterText
|
||||
required property string avatar
|
||||
required property string name
|
||||
required property string displayName
|
||||
|
||||
topPadding: Kirigami.Units.largeSpacing
|
||||
leftPadding: Kirigami.Units.largeSpacing
|
||||
@@ -34,7 +34,7 @@ QQC2.ItemDelegate {
|
||||
|
||||
contentItem: Kirigami.Avatar {
|
||||
source: root.avatar ? `image://mxc/${root.avatar}` : ""
|
||||
name: root.name || i18n("No Name")
|
||||
name: root.displayName
|
||||
|
||||
sourceSize {
|
||||
width: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
||||
@@ -48,6 +48,6 @@ QQC2.ItemDelegate {
|
||||
Keys.onReturnPressed: RoomManager.enterRoom(root.currentRoom)
|
||||
|
||||
QQC2.ToolTip.visible: text.length > 0 && hovered
|
||||
QQC2.ToolTip.text: root.name ?? ""
|
||||
QQC2.ToolTip.text: root.displayName ?? ""
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ Kirigami.BasicListItem {
|
||||
required property string avatar
|
||||
required property string subtitleText
|
||||
|
||||
required property string name
|
||||
required property string displayName
|
||||
|
||||
readonly property bool hasNotifications: notificationCount > 0
|
||||
|
||||
@@ -38,7 +38,7 @@ Kirigami.BasicListItem {
|
||||
icon: undefined
|
||||
bold: root.hasNotifications
|
||||
|
||||
label: root.name ?? ""
|
||||
label: root.displayName
|
||||
labelItem.textFormat: Text.PlainText
|
||||
|
||||
subtitle: root.subtitleText
|
||||
@@ -61,7 +61,7 @@ Kirigami.BasicListItem {
|
||||
|
||||
leading: Kirigami.Avatar {
|
||||
source: root.avatar ? `image://mxc/${root.avatar}` : ""
|
||||
name: root.name || i18n("No Name")
|
||||
name: root.displayName
|
||||
implicitWidth: visible ? height : 0
|
||||
visible: Config.showAvatarInRoomDrawer
|
||||
sourceSize {
|
||||
|
||||
@@ -81,9 +81,9 @@ QQC2.Control {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: width
|
||||
display: Kirigami.NavigationTabButton.IconOnly
|
||||
text: model.name
|
||||
text: model.displayName
|
||||
source: model.avatar ? ("image://mxc/" + model.avatar) : ""
|
||||
name: model.name
|
||||
name: model.displayName
|
||||
onClicked: root.selectedSpaceId = model.id
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.text: text
|
||||
|
||||
Reference in New Issue
Block a user