on xenial help sign in
Avoid using accessing notification in MenuItemFactory.
commit4a42a644a306f957910af2468b3a3c7680b80015 authorMirco Müller <mirco.mueller@ubuntu.com> dateFri 8 Aug 2014, 12:44 (12 years ago) parentd9d6289
2 files changed+6−7
qml/Notifications/Notification.qml+3−6 qml/Notifications/NotificationMenuItemFactory.qml+3−1
qml/Notifications/Notification.qml+3−6
@@ -141,12 +141,6 @@ Item {
141141 opacity: parent.opacity
142142 }
143143
144− signal accept()
145−
146− onAccept: {
147− notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
148− }
149−
150144 Item {
151145 id: contents
152146 anchors.fill: fullscreen ? nonShapedBack : shapedBack
@@ -317,6 +311,9 @@ Item {
317311 onLoaded: {
318312 notification.fullscreen = Qt.binding(function() { return fullscreen; });
319313 }
314+ onAccepted: {
315+ notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
316+ }
320317 }
321318 }
322319 }
qml/Notifications/NotificationMenuItemFactory.qml+3−1
@@ -30,6 +30,8 @@ Loader {
3030 property int maxHeight
3131 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
3232
33+ signal accepted()
34+
3335 property var _map: {
3436 "com.canonical.snapdecision.textfield": textfield,
3537 "com.canonical.snapdecision.pinlock" : pinLock,
@@ -80,7 +82,7 @@ Loader {
8082 menuModel.changeState(menuIndex, text);
8183 }
8284 onAccepted: {
83− notification.accept()
85+ menuFactory.accepted()
8486 }
8587 }
8688