Don't load empty images from imageprovider
Previously, when there was no avatar set, the source property of Avatar was still set to 'image://mxc/',
which caused Avatar to load that from the imageprovider. The imageprovider can't provide an empty image and aborts with error
(cherry picked from commit 724f10a895)
This commit is contained in:
committed by
Carl Schwan
parent
e87ae48f17
commit
893bc79f1e
@@ -89,7 +89,7 @@ ToolBar {
|
|||||||
Layout.preferredWidth: Kirigami.Units.gridUnit
|
Layout.preferredWidth: Kirigami.Units.gridUnit
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit
|
Layout.preferredHeight: Kirigami.Units.gridUnit
|
||||||
|
|
||||||
source: replyUser ? "image://mxc/" + replyUser.avatarMediaId: ""
|
source: replyUser ? ("image://mxc/" + replyUser.avatarMediaId) : ""
|
||||||
name: replyUser ? replyUser.displayName : i18n("No name")
|
name: replyUser ? replyUser.displayName : i18n("No name")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ ToolBar {
|
|||||||
Kirigami.Avatar {
|
Kirigami.Avatar {
|
||||||
Layout.preferredWidth: Kirigami.Units.gridUnit
|
Layout.preferredWidth: Kirigami.Units.gridUnit
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit
|
Layout.preferredHeight: Kirigami.Units.gridUnit
|
||||||
source: modelData.avatarMediaId ? "image://mxc/" + modelData.avatarMediaId : ""
|
source: modelData.avatarMediaId ? ("image://mxc/" + modelData.avatarMediaId) : ""
|
||||||
color: modelData.color ? Qt.darker(modelData.color, 1.1) : null
|
color: modelData.color ? Qt.darker(modelData.color, 1.1) : null
|
||||||
visible: !isEmoji
|
visible: !isEmoji
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ RowLayout {
|
|||||||
|
|
||||||
visible: showAuthor && Config.showAvatarInTimeline
|
visible: showAuthor && Config.showAvatarInTimeline
|
||||||
name: author.displayName
|
name: author.displayName
|
||||||
source: author.avatarMediaId ? "image://mxc/" + author.avatarMediaId : ""
|
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
||||||
color: author.color
|
color: author.color
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ QQC2.AbstractButton {
|
|||||||
Layout.preferredHeight: Kirigami.Units.gridUnit
|
Layout.preferredHeight: Kirigami.Units.gridUnit
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
visible: Config.showAvatarInTimeline
|
visible: Config.showAvatarInTimeline
|
||||||
source: replyVisible && reply.author.avatarMediaId ? "image://mxc/" + reply.author.avatarMediaId : ""
|
source: replyVisible && reply.author.avatarMediaId ? ("image://mxc/" + reply.author.avatarMediaId) : ""
|
||||||
name: replyVisible ? reply.author.displayName : "H"
|
name: replyVisible ? reply.author.displayName : "H"
|
||||||
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor
|
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ RowLayout {
|
|||||||
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
||||||
|
|
||||||
name: author.displayName
|
name: author.displayName
|
||||||
source: author.avatarMediaId ? "image://mxc/" + author.avatarMediaId : ""
|
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
||||||
color: author.color
|
color: author.color
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Kirigami.OverlaySheet {
|
|||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
name: room.displayName
|
name: room.displayName
|
||||||
source: room.avatarMediaId ? "image://mxc/" + room.avatarMediaId : ""
|
source: room.avatarMediaId ? ("image://mxc/" + room.avatarMediaId) : ""
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ Kirigami.OverlaySheet {
|
|||||||
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
|
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
|
||||||
|
|
||||||
name: displayName
|
name: displayName
|
||||||
source: avatarMediaId ? "image://mxc/" + avatarMediaId : ""
|
source: avatarMediaId ? ("image://mxc/" + avatarMediaId) : ""
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Kirigami.OverlaySheet {
|
|||||||
spacing: Kirigami.Units.largeSpacing
|
spacing: Kirigami.Units.largeSpacing
|
||||||
Kirigami.Avatar {
|
Kirigami.Avatar {
|
||||||
id: avatar
|
id: avatar
|
||||||
source: author.avatarMediaId ? "image://mxc/" + author.avatarMediaId : ""
|
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
||||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 3
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 3
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ Kirigami.ScrollablePage {
|
|||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
source: avatar ? "image://mxc/" + avatar : ""
|
source: avatar ? ("image://mxc/" + avatar) : ""
|
||||||
name: name
|
name: name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ Kirigami.ScrollablePage {
|
|||||||
Layout.preferredWidth: Kirigami.Units.iconSizes.huge
|
Layout.preferredWidth: Kirigami.Units.iconSizes.huge
|
||||||
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
|
Layout.preferredHeight: Kirigami.Units.iconSizes.huge
|
||||||
|
|
||||||
source: model.avatar ? "image://mxc/" + model.avatar : ""
|
source: model.avatar ? ("image://mxc/" + model.avatar) : ""
|
||||||
name: name
|
name: name
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ Kirigami.ScrollablePage {
|
|||||||
Layout.minimumWidth: size
|
Layout.minimumWidth: size
|
||||||
Layout.maximumWidth: size
|
Layout.maximumWidth: size
|
||||||
|
|
||||||
source: avatar ? "image://mxc/" + avatar : ""
|
source: avatar ? ("image://mxc/" + avatar) : ""
|
||||||
name: model.name || i18n("No Name")
|
name: model.name || i18n("No Name")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ Kirigami.OverlayDrawer {
|
|||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 3.5
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 3.5
|
||||||
|
|
||||||
name: room ? room.displayName : i18n("No name")
|
name: room ? room.displayName : i18n("No name")
|
||||||
source: room ? "image://mxc/" + room.avatarMediaId : undefined
|
source: room ? ("image://mxc/" + room.avatarMediaId) : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@@ -190,7 +190,7 @@ Kirigami.OverlayDrawer {
|
|||||||
Layout.preferredWidth: height
|
Layout.preferredWidth: height
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
source: "image://mxc/" + avatar
|
source: avatar ? ("image://mxc/" + avatar) : ""
|
||||||
name: name
|
name: name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user