Downloaded files: include title + ext in filename
This commit is contained in:
@@ -18,6 +18,7 @@ Rectangle {
|
||||
|
||||
property string name
|
||||
property alias mxc: avatarImage.mxc
|
||||
property alias title: avatarImage.title
|
||||
|
||||
property alias toolTipMxc: avatarToolTipImage.mxc
|
||||
property alias sourceOverride: avatarImage.sourceOverride
|
||||
@@ -77,6 +78,7 @@ Rectangle {
|
||||
id: avatarToolTipImage
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
mxc: avatarImage.mxc
|
||||
title: avatarImage.title
|
||||
|
||||
sourceSize.width: avatarToolTip.dimension
|
||||
sourceSize.height: avatarToolTip.dimension
|
||||
|
@@ -13,6 +13,7 @@ HImage {
|
||||
|
||||
|
||||
property string mxc
|
||||
property string title
|
||||
property string sourceOverride: ""
|
||||
property bool thumbnail: true
|
||||
property var cryptDict: ({})
|
||||
@@ -41,7 +42,8 @@ HImage {
|
||||
|
||||
const method = image.thumbnail ? "get_thumbnail" : "get_media"
|
||||
const args = image.thumbnail ?
|
||||
[image.mxc, w, h, cryptDict] : [image.mxc, cryptDict]
|
||||
[image.mxc, image.title, w, h, cryptDict] :
|
||||
[image.mxc, image.title, cryptDict]
|
||||
|
||||
py.callCoro("media_cache." + method, args, path => {
|
||||
if (! image) return
|
||||
|
@@ -7,6 +7,9 @@ HAvatar {
|
||||
displayName.substring(1) :
|
||||
displayName
|
||||
|
||||
title: "room_" + roomId + ".avatar"
|
||||
|
||||
|
||||
property string roomId
|
||||
property string displayName
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import QtQuick 2.12
|
||||
|
||||
HAvatar {
|
||||
name: displayName || userId.substring(1) // no leading @
|
||||
title: "user_" + userId + ".avatar"
|
||||
|
||||
|
||||
property string userId
|
||||
|
@@ -12,6 +12,7 @@ HTileDelegate {
|
||||
opacity: model.left ? theme.mainPane.room.leftRoomOpacity : 1
|
||||
|
||||
image: HRoomAvatar {
|
||||
roomId: model.id
|
||||
displayName: model.display_name
|
||||
mxc: model.avatar_url
|
||||
}
|
||||
|
@@ -56,6 +56,7 @@ HBox {
|
||||
|
||||
HRoomAvatar {
|
||||
id: avatar
|
||||
roomId: ""
|
||||
displayName: nameField.text
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
@@ -14,6 +14,7 @@ Rectangle {
|
||||
|
||||
HRoomAvatar {
|
||||
id: avatar
|
||||
roomId: chat.roomId
|
||||
displayName: chat.roomInfo.display_name
|
||||
mxc: chat.roomInfo.avatar_url
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
@@ -55,6 +55,7 @@ HBox {
|
||||
|
||||
HRoomAvatar {
|
||||
id: avatar
|
||||
roomId: chat.roomId
|
||||
displayName: chat.roomInfo.display_name
|
||||
mxc: chat.roomInfo.avatar_url
|
||||
// enabled: chat.roomInfo.can_set_avatar # put this in "change avatar"
|
||||
|
@@ -9,6 +9,7 @@ HMxcImage {
|
||||
height: fitSize.height
|
||||
horizontalAlignment: Image.AlignLeft
|
||||
|
||||
title: loader.title
|
||||
animated: loader.singleMediaInfo.media_mime === "image/gif" ||
|
||||
utils.urlExtension(loader.mediaUrl).toLowerCase() === "gif"
|
||||
thumbnail: ! animated && loader.thumbnailMxc
|
||||
|
@@ -85,6 +85,7 @@ HLoader {
|
||||
|
||||
const args = [
|
||||
loader.mediaUrl,
|
||||
loader.title,
|
||||
JSON.parse(loader.singleMediaInfo.media_crypt_dict)
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user