@@ -27,11 +27,14 @@ import Unity.Notifications 1.0
2727import QtMultimedia 5.0
2828
2929Item {
30+ id: foobar
31+
3032 width: notificationsRect.width + interactiveControls.width
3133 height: notificationsRect.height
3234
3335 property list<Notification> mockList: [
3436 Notification {
37+ id: n0
3538 nid: 0
3639 type: Notification.PlaceHolder
3740 summary: ""
@@ -39,8 +42,12 @@ Item {
3942 icon: ""
4043 secondaryIcon: ""
4144 rawActions: ["reply_id", "Dummy"]
45+ Component.onCompleted: {
46+ n0.completed.connect(mockModel.remove)
47+ }
4248 },
4349 Notification {
50+ id: n1
4451 nid: 1
4552 type: Notification.SnapDecision
4653 hints: {"x-canonical-private-affirmative-tint": "true"}
@@ -51,8 +58,12 @@ Item {
5158 rawActions: ["ok_id", "Ok",
5259 "snooze_id", "Snooze",
5360 "view_id", "View"]
61+ Component.onCompleted: {
62+ n1.completed.connect(mockModel.remove)
63+ }
5464 },
5565 Notification {
66+ id: n2
5667 nid: 2
5768 type: Notification.Ephemeral
5869 summary: "Cole Raby"
@@ -60,8 +71,12 @@ Item {
6071 icon: "../graphics/avatars/amanda.png"
6172 secondaryIcon: "../graphics/applicationIcons/facebook.png"
6273 rawActions: ["reply_id", "Dummy"]
74+ Component.onCompleted: {
75+ n2.completed.connect(mockModel.remove)
76+ }
6377 },
6478 Notification {
79+ id: n3
6580 nid: 3
6681 type: Notification.Ephemeral
6782 hints: {"x-canonical-non-shaped-icon": "true"}
@@ -70,8 +85,12 @@ Item {
7085 icon: "../graphics/applicationIcons/contacts-app.png"
7186 secondaryIcon: ""
7287 rawActions: ["reply_id", "Dummy"]
88+ Component.onCompleted: {
89+ n3.completed.connect(mockModel.remove)
90+ }
7391 },
7492 Notification {
93+ id: n4
7594 nid: 4
7695 type: Notification.Ephemeral
7796 hints: {"x-canonical-non-shaped-icon": "false"}
@@ -80,8 +99,12 @@ Item {
8099 icon: "../graphics/applicationIcons/facebook.png"
81100 secondaryIcon: ""
82101 rawActions: ["reply_id", "Dummy"]
102+ Component.onCompleted: {
103+ n4.completed.connect(mockModel.remove)
104+ }
83105 },
84106 Notification {
107+ id: n5
85108 nid: 5
86109 type: Notification.Interactive
87110 summary: "Interactive notification"
@@ -89,8 +112,12 @@ Item {
89112 icon: "../graphics/avatars/anna_olsson.png"
90113 secondaryIcon: ""
91114 rawActions: ["reply_id", "Dummy"]
115+ Component.onCompleted: {
116+ n5.completed.connect(mockModel.remove)
117+ }
92118 },
93119 Notification {
120+ id: n6
94121 nid: 6
95122 type: Notification.Confirmation
96123 hints: {"x-canonical-non-shaped-icon": "true"}
@@ -100,8 +127,12 @@ Item {
100127 secondaryIcon: ""
101128 value: 50
102129 rawActions: ["reply_id", "Dummy"]
130+ Component.onCompleted: {
131+ n6.completed.connect(mockModel.remove)
132+ }
103133 },
104134 Notification {
135+ id: n7
105136 nid: 7
106137 type: Notification.Confirmation
107138 hints: {"x-canonical-non-shaped-icon": "true",
@@ -112,6 +143,9 @@ Item {
112143 secondaryIcon: ""
113144 value: 85
114145 rawActions: ["reply_id", "Dummy"]
146+ Component.onCompleted: {
147+ n7.completed.connect(mockModel.remove)
148+ }
115149 }
116150 ]
117151
@@ -159,13 +193,13 @@ Item {
159193
160194 function clearNotifications() {
161195 while(mockModel.count > 1) {
162− remove1stNotification()
196+ //remove1stNotification()
163197 }
164198 }
165199
166200 function remove1stNotification() {
167201 if (mockModel.count > 1) {
168− mockModel.remove(1)
202+ //mockModel.remove(1)
169203 }
170204 }
171205