Fix a crash in message delegate menu involving nil reference.

This commit is contained in:
Black Hat
2019-10-17 02:44:56 -07:00
parent c666ffbba5
commit f4f478973f
5 changed files with 5 additions and 5 deletions

View File

@@ -133,7 +133,7 @@ RowLayout {
id: messageMouseArea id: messageMouseArea
onSecondaryClicked: { onSecondaryClicked: {
var contextMenu = fileDelegateContextMenu.createObject(ApplicationWindow.overlay) var contextMenu = fileDelegateContextMenu.createObject(root)
contextMenu.viewSource.connect(function() { contextMenu.viewSource.connect(function() {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open() messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
}) })

View File

@@ -159,7 +159,7 @@ RowLayout {
id: messageMouseArea id: messageMouseArea
onSecondaryClicked: { onSecondaryClicked: {
var contextMenu = fileDelegateContextMenu.createObject(ApplicationWindow.overlay) var contextMenu = fileDelegateContextMenu.createObject(root)
contextMenu.viewSource.connect(function() { contextMenu.viewSource.connect(function() {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open() messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
}) })

View File

@@ -153,7 +153,7 @@ RowLayout {
onPrimaryClicked: fullScreenImage.createObject(parent, {"filename": eventId, "localPath": currentRoom.urlToDownload(eventId)}).showFullScreen() onPrimaryClicked: fullScreenImage.createObject(parent, {"filename": eventId, "localPath": currentRoom.urlToDownload(eventId)}).showFullScreen()
onSecondaryClicked: { onSecondaryClicked: {
var contextMenu = imageDelegateContextMenu.createObject(ApplicationWindow.overlay) var contextMenu = imageDelegateContextMenu.createObject(root)
contextMenu.viewSource.connect(function() { contextMenu.viewSource.connect(function() {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open() messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
}) })

View File

@@ -98,7 +98,7 @@ ColumnLayout {
id: messageMouseArea id: messageMouseArea
onSecondaryClicked: { onSecondaryClicked: {
var contextMenu = messageDelegateContextMenu.createObject(ApplicationWindow.overlay) var contextMenu = messageDelegateContextMenu.createObject(root)
contextMenu.viewSource.connect(function() { contextMenu.viewSource.connect(function() {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open() messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
}) })

View File

@@ -218,7 +218,7 @@ RowLayout {
} }
onSecondaryClicked: { onSecondaryClicked: {
var contextMenu = imageDelegateContextMenu.createObject(ApplicationWindow.overlay) var contextMenu = imageDelegateContextMenu.createObject(root)
contextMenu.viewSource.connect(function() { contextMenu.viewSource.connect(function() {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open() messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
}) })