MobileTextActionsToolBar check if controlRoot is undefined before using it
Summary: Prevents warning such as qml/org/kde/plasma/components.3/mobiletextselection/MobileTextActionsToolBar.qml:62: TypeError: Cannot read property 'selectedText' of null qml/org/kde/plasma/components.3/mobiletextselection/MobileTextActionsToolBar.qml:70: TypeError: Cannot read property 'selectedText' of null qml/org/kde/plasma/components.3/mobiletextselection/MobileTextActionsToolBar.qml:78: TypeError: Cannot read property 'canPaste' of null Reviewers: #plasma, apol Reviewed By: apol Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25164
This commit is contained in:
parent
876dafaedb
commit
000022b668
@ -59,7 +59,7 @@ Popup {
|
||||
ToolButton {
|
||||
focusPolicy: Qt.NoFocus
|
||||
icon.name: "edit-cut"
|
||||
visible: controlRoot.selectedText.length > 0 && (!controlRoot.hasOwnProperty("echoMode") || controlRoot.echoMode === TextInput.Normal)
|
||||
visible: controlRoot && controlRoot.selectedText.length > 0 && (!controlRoot.hasOwnProperty("echoMode") || controlRoot.echoMode === TextInput.Normal)
|
||||
onClicked: {
|
||||
controlRoot.cut();
|
||||
}
|
||||
@ -67,7 +67,7 @@ Popup {
|
||||
ToolButton {
|
||||
focusPolicy: Qt.NoFocus
|
||||
icon.name: "edit-copy"
|
||||
visible: controlRoot.selectedText.length > 0 && (!controlRoot.hasOwnProperty("echoMode") || controlRoot.echoMode === TextInput.Normal)
|
||||
visible: controlRoot && controlRoot.selectedText.length > 0 && (!controlRoot.hasOwnProperty("echoMode") || controlRoot.echoMode === TextInput.Normal)
|
||||
onClicked: {
|
||||
controlRoot.copy();
|
||||
}
|
||||
@ -75,7 +75,7 @@ Popup {
|
||||
ToolButton {
|
||||
focusPolicy: Qt.NoFocus
|
||||
icon.name: "edit-paste"
|
||||
visible: controlRoot.canPaste
|
||||
visible: controlRoot && controlRoot.canPaste
|
||||
onClicked: {
|
||||
controlRoot.paste();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user