on xenial help sign in
Avoid using accessing notification in MenuItemFactory.
4a42a64Mirco Müller
qml/Notifications/Notification.qml+3−6
@@ -141,12 +141,6 @@ Item {
141 opacity: parent.opacity
141 opacity: parent.opacity
142 }
142 }
143
143
144− signal accept()
145−
146− onAccept: {
147− notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
148− }
149−
150 Item {
144 Item {
151 id: contents
145 id: contents
152 anchors.fill: fullscreen ? nonShapedBack : shapedBack
146 anchors.fill: fullscreen ? nonShapedBack : shapedBack
@@ -317,6 +311,9 @@ Item {
317 onLoaded: {
311 onLoaded: {
318 notification.fullscreen = Qt.binding(function() { return fullscreen; });
312 notification.fullscreen = Qt.binding(function() { return fullscreen; });
319 }
313 }
314+ onAccepted: {
315+ notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
316+ }
320 }
317 }
321 }
318 }
322 }
319 }
qml/Notifications/NotificationMenuItemFactory.qml+3−1
@@ -30,6 +30,8 @@ Loader {
30 property int maxHeight
30 property int maxHeight
31 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
31 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
32
32
33+ signal accepted()
34+
33 property var _map: {
35 property var _map: {
34 "com.canonical.snapdecision.textfield": textfield,
36 "com.canonical.snapdecision.textfield": textfield,
35 "com.canonical.snapdecision.pinlock" : pinLock,
37 "com.canonical.snapdecision.pinlock" : pinLock,
@@ -80,7 +82,7 @@ Loader {
80 menuModel.changeState(menuIndex, text);
82 menuModel.changeState(menuIndex, text);
81 }
83 }
82 onAccepted: {
84 onAccepted: {
83− notification.accept()
85+ menuFactory.accepted()
84 }
86 }
85 }
87 }
86
88