Fix Delegate Menu in NeochatMaximizeComponent
Make sure NeochatMaximizeComponent provides all the required properties to the delegate menu
This commit is contained in:
@@ -14,6 +14,11 @@ import org.kde.neochat 1.0
|
||||
Components.AlbumMaximizeComponent {
|
||||
id: root
|
||||
|
||||
/**
|
||||
* @brief The current room that user is viewing.
|
||||
*/
|
||||
required property NeoChatRoom currentRoom
|
||||
|
||||
readonly property string currentEventId: model.data(model.index(content.currentIndex, 0), MessageEventModel.EventIdRole)
|
||||
|
||||
readonly property var currentAuthor: model.data(model.index(content.currentIndex, 0), MessageEventModel.AuthorRole)
|
||||
@@ -84,8 +89,10 @@ Components.AlbumMaximizeComponent {
|
||||
author: root.currentAuthor,
|
||||
eventId: root.currentEventId,
|
||||
file: parent,
|
||||
mimeType: root.currentMimeType,
|
||||
progressInfo: root.currentProgressInfo,
|
||||
plainText: root.currentPlainText
|
||||
plainText: root.currentPlainText,
|
||||
connection: root.currentRoom.connection
|
||||
});
|
||||
contextMenu.closeFullscreen.connect(root.close)
|
||||
contextMenu.open();
|
||||
|
||||
@@ -330,6 +330,7 @@ QQC2.ScrollView {
|
||||
Component {
|
||||
id: maximizeComponent
|
||||
NeochatMaximizeComponent {
|
||||
currentRoom: root.currentRoom
|
||||
model: RoomManager.mediaMessageFilterModel
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,11 @@ MessageDelegateContextMenu {
|
||||
|
||||
signal closeFullscreen
|
||||
|
||||
/**
|
||||
* @brief The MIME type of the media.
|
||||
*/
|
||||
property string mimeType
|
||||
|
||||
required property var file
|
||||
required property var progressInfo
|
||||
|
||||
@@ -99,7 +104,7 @@ MessageDelegateContextMenu {
|
||||
id: shareAction
|
||||
inputData: {
|
||||
'urls': [],
|
||||
'mimeType': [root.file.mediaInfo.mimeType]
|
||||
'mimeType': [root.mimeType ? root.mimeType : root.file.mediaINfo.mimeType]
|
||||
}
|
||||
property string filename: StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/" + eventId.replace(":", "_").replace("/", "_").replace("+", "_") + currentRoom.fileNameToDownload(eventId);
|
||||
|
||||
@@ -109,7 +114,7 @@ MessageDelegateContextMenu {
|
||||
Component.onCompleted: {
|
||||
shareAction.inputData = {
|
||||
urls: [filename],
|
||||
mimeType: [root.file.mediaInfo.mimeType]
|
||||
mimeType: [root.mimeType ? root.mimeType : root.file.mediaINfo.mimeType]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user