@@ -38,8 +38,12 @@ Item {
3838 mockModel.actionInvoked(actionId)
3939 }
4040
41− function close() {
42− mockModel.remove(1)
41+ function close(id) {
42+ for (var i = 0; i < mockModel.count; i++) {
43+ if (id === mockModel.get(i).id) {
44+ mockModel.remove(i)
45+ }
46+ }
4347 }
4448 }
4549 }
@@ -49,6 +53,11 @@ Item {
4953 dynamicRoles: true
5054
5155 signal actionInvoked(string actionId)
56+ property var internalId: 0
57+
58+ function getNextId() {
59+ return internalId++
60+ }
5261
5362 function getRaw(id) {
5463 return mockNotification.createObject(mockModel)
@@ -58,6 +67,7 @@ Item {
5867 Component.onCompleted: {
5968 var n = {
6069 type: Notification.PlaceHolder,
70+ id: mockModel.getNextId(),
6171 hints: {},
6272 summary: "",
6373 body: "",
@@ -73,6 +83,7 @@ Item {
7383 function add2over1SnapDecisionNotification() {
7484 var n = {
7585 type: Notification.SnapDecision,
86+ id: mockModel.getNextId(),
7687 hints: {"x-canonical-private-affirmative-tint": "true"},
7788 summary: "Theatre at Ferria Stadium",
7889 body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
@@ -89,6 +100,7 @@ Item {
89100 function addEphemeralNotification() {
90101 var n = {
91102 type: Notification.Ephemeral,
103+ id: mockModel.getNextId(),
92104 summary: "Cole Raby",
93105 body: "I did not expect it to be that late.",
94106 icon: "../graphics/avatars/amanda.png",
@@ -102,6 +114,7 @@ Item {
102114 function addEphemeralNonShapedIconNotification() {
103115 var n = {
104116 type: Notification.Ephemeral,
117+ id: mockModel.getNextId(),
105118 hints: {"x-canonical-non-shaped-icon": "true"},
106119 summary: "Contacts",
107120 body: "Synchronised contacts-database with cloud-storage.",
@@ -116,6 +129,7 @@ Item {
116129 function addEphemeralIconSummaryNotification() {
117130 var n = {
118131 type: Notification.Ephemeral,
132+ id: mockModel.getNextId(),
119133 hints: {"x-canonical-non-shaped-icon": "false"},
120134 summary: "Photo upload completed",
121135 body: "",
@@ -130,6 +144,7 @@ Item {
130144 function addInteractiveNotification() {
131145 var n = {
132146 type: Notification.Interactive,
147+ id: mockModel.getNextId(),
133148 summary: "Interactive notification",
134149 body: "This is a notification that can be clicked",
135150 icon: "../graphics/avatars/anna_olsson.png",
@@ -143,6 +158,7 @@ Item {
143158 function addConfirmationNotification() {
144159 var n = {
145160 type: Notification.Confirmation,
161+ id: mockModel.getNextId(),
146162 hints: {"x-canonical-non-shaped-icon": "true"},
147163 summary: "Confirmation notification",
148164 body: "",
@@ -158,6 +174,7 @@ Item {
158174 function add2ndConfirmationNotification() {
159175 var n = {
160176 type: Notification.Confirmation,
177+ id: mockModel.getNextId(),
161178 hints: {"x-canonical-non-shaped-icon": "true",
162179 "x-canonical-value-bar-tint": "true"},
163180 summary: "Confirmation notification",
@@ -282,6 +299,7 @@ Item {
282299 {
283300 tag: "2-over-1 Snap Decision with button-tint",
284301 type: Notification.SnapDecision,
302+ id: mockModel.getNextId(),
285303 hints: {"x-canonical-private-affirmative-tint": "true"},
286304 summary: "Theatre at Ferria Stadium",
287305 body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
@@ -306,6 +324,7 @@ Item {
306324 {
307325 tag: "Ephemeral notification - icon-summary layout",
308326 type: Notification.Ephemeral,
327+ id: mockModel.getNextId(),
309328 hints: {},
310329 summary: "Photo upload completed",
311330 body: "",
@@ -328,6 +347,7 @@ Item {
328347 {
329348 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
330349 type: Notification.Ephemeral,
350+ id: mockModel.getNextId(),
331351 hints: {"x-canonical-private-affirmative-tint": "false",
332352 "sound-file": "dummy.ogg",
333353 "suppress-sound": "true"},
@@ -353,6 +373,7 @@ Item {
353373 {
354374 tag: "Interactive notification",
355375 type: Notification.Interactive,
376+ id: mockModel.getNextId(),
356377 hints: {"x-canonical-private-affirmative-tint": "false",
357378 "sound-file": "dummy.ogg"},
358379 summary: "Interactive notification",
@@ -376,6 +397,7 @@ Item {
376397 {
377398 tag: "Snap Decision without secondary icon and no button-tint",
378399 type: Notification.SnapDecision,
400+ id: mockModel.getNextId(),
379401 hints: {"x-canonical-private-affirmative-tint": "false",
380402 "sound-file": "dummy.ogg"},
381403 summary: "Bro Coly",
@@ -400,6 +422,7 @@ Item {
400422 {
401423 tag: "Ephemeral notification",
402424 type: Notification.Ephemeral,
425+ id: mockModel.getNextId(),
403426 hints: {"x-canonical-private-affirmative-tint": "false",
404427 "sound-file": "dummy.ogg"},
405428 summary: "Cole Raby",
@@ -423,6 +446,7 @@ Item {
423446 {
424447 tag: "Ephemeral notification with non-shaped icon",
425448 type: Notification.Ephemeral,
449+ id: mockModel.getNextId(),
426450 hints: {"x-canonical-private-affirmative-tint": "false",
427451 "x-canonical-non-shaped-icon": "true"},
428452 summary: "Contacts",
@@ -446,6 +470,7 @@ Item {
446470 {
447471 tag: "Confirmation notification with value",
448472 type: Notification.Confirmation,
473+ id: mockModel.getNextId(),
449474 hints: {"x-canonical-non-shaped-icon": "true"},
450475 summary: "",
451476 body: "",
@@ -469,6 +494,7 @@ Item {
469494 {
470495 tag: "Confirmation notification with value, label and tint",
471496 type: Notification.Confirmation,
497+ id: mockModel.getNextId(),
472498 hints: {"x-canonical-non-shaped-icon": "true",
473499 "x-canonical-value-bar-tint" : "true"},
474500 summary: "",