on xenial help sign in
Make all tests pass again
commit10113e9723986bb33967e3df3a5402e3eae8c693 authorMirco Müller <mirco.mueller@canonical.com> dateFri 14 Jun 2013, 16:29 (13 years ago) parente9fe9d8
3 files changed+27−4
Notifications/Notification.qml+9−3 Notifications/Notifications.qml+1−1 tests/qmltests/Notifications/tst_Notifications.qml+17
Notifications/Notification.qml+9−3
@@ -41,13 +41,16 @@ UbuntuShape {
4141
4242 Repeater {
4343 id: actionRepeater
44− model: actions
44+ model: notification.actions
4545 }
4646
4747 anchors.fill: contentColumn
4848 objectName: "interactiveArea"
4949 enabled: notification.type == Notification.Interactive
50− onClicked: notification.notification.invokeAction(actionRepeater.model.actionId(0))
50+ onClicked: {
51+ notification.notification.invokeAction(actionRepeater.model.get(0).id)
52+ actionInvoked(actionRepeater.model.get(0).id)
53+ }
5154 }
5255
5356 Column {
@@ -153,7 +156,10 @@ UbuntuShape {
153156 width: (buttonRow.width - buttonRow.spacing) / 2
154157 height: units.gu(4)
155158 text: label
156− onClicked: notification.notification.invokeAction(id)
159+ onClicked: {
160+ notification.notification.invokeAction(id)
161+ actionInvoked(id)
162+ }
157163 }
158164 }
159165 }
Notifications/Notifications.qml+1−1
@@ -39,7 +39,7 @@ ListView {
3939 body: model.body
4040 actions: model.actions
4141 notificationId: model.id
42− notification: notificationList.model.get(notificationId)
42+ notification: notificationList.model.getRaw(notificationId)
4343 }
4444
4545 populate: Transition {
tests/qmltests/Notifications/tst_Notifications.qml+17
@@ -25,8 +25,25 @@ import Unity.Notifications 1.0
2525Row {
2626 id: rootRow
2727
28+ Component {
29+ id: mockNotification
30+
31+ QtObject {
32+
33+ signal actionInvoked()
34+
35+ function invokeAction(actionId) {
36+ actionInvoked()
37+ }
38+ }
39+ }
40+
2841 ListModel {
2942 id: mockModel
43+
44+ function getRaw(id) {
45+ return mockNotification.createObject(mockModel)
46+ }
3047 }
3148
3249 function addSnapDecisionNotification() {