@@ -38,8 +38,12 @@ Item {
38 mockModel.actionInvoked(actionId)
38 mockModel.actionInvoked(actionId)
41− function close() {
41+ function close(id) {
42+ for (var i = 0; i < mockModel.count; i++) {
43+ if (id === mockModel.get(i).id) {
42− mockModel.remove(1)
44+ mockModel.remove(i)
@@ -49,6 +53,11 @@ Item {
49 dynamicRoles: true
53 dynamicRoles: true
51 signal actionInvoked(string actionId)
55 signal actionInvoked(string actionId)
56+ property var internalId: 0
58+ function getNextId() {
53 function getRaw(id) {
62 function getRaw(id) {
54 return mockNotification.createObject(mockModel)
63 return mockNotification.createObject(mockModel)
@@ -58,6 +67,7 @@ Item {
58 Component.onCompleted: {
67 Component.onCompleted: {
60 type: Notification.PlaceHolder,
69 type: Notification.PlaceHolder,
70+ id: mockModel.getNextId(),
61 hints: {},
71 hints: {},
62 summary: "",
72 summary: "",
@@ -73,6 +83,7 @@ Item {
73 function add2over1SnapDecisionNotification() {
83 function add2over1SnapDecisionNotification() {
75 type: Notification.SnapDecision,
85 type: Notification.SnapDecision,
86+ id: mockModel.getNextId(),
76 hints: {"x-canonical-private-affirmative-tint": "true"},
87 hints: {"x-canonical-private-affirmative-tint": "true"},
77 summary: "Theatre at Ferria Stadium",
88 summary: "Theatre at Ferria Stadium",
78 body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
89 body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
@@ -89,6 +100,7 @@ Item {
89 function addEphemeralNotification() {
100 function addEphemeralNotification() {
90 var n = {
101 var n = {
91 type: Notification.Ephemeral,
102 type: Notification.Ephemeral,
103+ id: mockModel.getNextId(),
92 summary: "Cole Raby",
104 summary: "Cole Raby",
93 body: "I did not expect it to be that late.",
105 body: "I did not expect it to be that late.",
94 icon: "../graphics/avatars/amanda.png",
106 icon: "../graphics/avatars/amanda.png",
@@ -102,6 +114,7 @@ Item {
102 function addEphemeralNonShapedIconNotification() {
114 function addEphemeralNonShapedIconNotification() {
103 var n = {
115 var n = {
104 type: Notification.Ephemeral,
116 type: Notification.Ephemeral,
117+ id: mockModel.getNextId(),
105 hints: {"x-canonical-non-shaped-icon": "true"},
118 hints: {"x-canonical-non-shaped-icon": "true"},
106 summary: "Contacts",
119 summary: "Contacts",
107 body: "Synchronised contacts-database with cloud-storage.",
120 body: "Synchronised contacts-database with cloud-storage.",
@@ -116,6 +129,7 @@ Item {
116 function addEphemeralIconSummaryNotification() {
129 function addEphemeralIconSummaryNotification() {
117 var n = {
130 var n = {
118 type: Notification.Ephemeral,
131 type: Notification.Ephemeral,
132+ id: mockModel.getNextId(),
119 hints: {"x-canonical-non-shaped-icon": "false"},
133 hints: {"x-canonical-non-shaped-icon": "false"},
120 summary: "Photo upload completed",
134 summary: "Photo upload completed",
121 body: "",
135 body: "",
@@ -130,6 +144,7 @@ Item {
130 function addInteractiveNotification() {
144 function addInteractiveNotification() {
131 var n = {
145 var n = {
132 type: Notification.Interactive,
146 type: Notification.Interactive,
147+ id: mockModel.getNextId(),
133 summary: "Interactive notification",
148 summary: "Interactive notification",
134 body: "This is a notification that can be clicked",
149 body: "This is a notification that can be clicked",
135 icon: "../graphics/avatars/anna_olsson.png",
150 icon: "../graphics/avatars/anna_olsson.png",
@@ -143,6 +158,7 @@ Item {
143 function addConfirmationNotification() {
158 function addConfirmationNotification() {
144 var n = {
159 var n = {
145 type: Notification.Confirmation,
160 type: Notification.Confirmation,
161+ id: mockModel.getNextId(),
146 hints: {"x-canonical-non-shaped-icon": "true"},
162 hints: {"x-canonical-non-shaped-icon": "true"},
147 summary: "Confirmation notification",
163 summary: "Confirmation notification",
148 body: "",
164 body: "",
@@ -158,6 +174,7 @@ Item {
158 function add2ndConfirmationNotification() {
174 function add2ndConfirmationNotification() {
159 var n = {
175 var n = {
160 type: Notification.Confirmation,
176 type: Notification.Confirmation,
177+ id: mockModel.getNextId(),
161 hints: {"x-canonical-non-shaped-icon": "true",
178 hints: {"x-canonical-non-shaped-icon": "true",
162 "x-canonical-value-bar-tint": "true"},
179 "x-canonical-value-bar-tint": "true"},
163 summary: "Confirmation notification",
180 summary: "Confirmation notification",
@@ -282,6 +299,7 @@ Item {
283 tag: "2-over-1 Snap Decision with button-tint",
300 tag: "2-over-1 Snap Decision with button-tint",
284 type: Notification.SnapDecision,
301 type: Notification.SnapDecision,
302+ id: mockModel.getNextId(),
285 hints: {"x-canonical-private-affirmative-tint": "true"},
303 hints: {"x-canonical-private-affirmative-tint": "true"},
286 summary: "Theatre at Ferria Stadium",
304 summary: "Theatre at Ferria Stadium",
287 body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
305 body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
@@ -306,6 +324,7 @@ Item {
307 tag: "Ephemeral notification - icon-summary layout",
325 tag: "Ephemeral notification - icon-summary layout",
308 type: Notification.Ephemeral,
326 type: Notification.Ephemeral,
327+ id: mockModel.getNextId(),
309 hints: {},
328 hints: {},
310 summary: "Photo upload completed",
329 summary: "Photo upload completed",
311 body: "",
330 body: "",
@@ -328,6 +347,7 @@ Item {
329 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
348 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
330 type: Notification.Ephemeral,
349 type: Notification.Ephemeral,
350+ id: mockModel.getNextId(),
331 hints: {"x-canonical-private-affirmative-tint": "false",
351 hints: {"x-canonical-private-affirmative-tint": "false",
332 "sound-file": "dummy.ogg",
352 "sound-file": "dummy.ogg",
333 "suppress-sound": "true"},
353 "suppress-sound": "true"},
@@ -353,6 +373,7 @@ Item {
354 tag: "Interactive notification",
374 tag: "Interactive notification",
355 type: Notification.Interactive,
375 type: Notification.Interactive,
376+ id: mockModel.getNextId(),
356 hints: {"x-canonical-private-affirmative-tint": "false",
377 hints: {"x-canonical-private-affirmative-tint": "false",
357 "sound-file": "dummy.ogg"},
378 "sound-file": "dummy.ogg"},
358 summary: "Interactive notification",
379 summary: "Interactive notification",
@@ -376,6 +397,7 @@ Item {
377 tag: "Snap Decision without secondary icon and no button-tint",
398 tag: "Snap Decision without secondary icon and no button-tint",
378 type: Notification.SnapDecision,
399 type: Notification.SnapDecision,
400+ id: mockModel.getNextId(),
379 hints: {"x-canonical-private-affirmative-tint": "false",
401 hints: {"x-canonical-private-affirmative-tint": "false",
380 "sound-file": "dummy.ogg"},
402 "sound-file": "dummy.ogg"},
381 summary: "Bro Coly",
403 summary: "Bro Coly",
@@ -400,6 +422,7 @@ Item {
401 tag: "Ephemeral notification",
423 tag: "Ephemeral notification",
402 type: Notification.Ephemeral,
424 type: Notification.Ephemeral,
425+ id: mockModel.getNextId(),
403 hints: {"x-canonical-private-affirmative-tint": "false",
426 hints: {"x-canonical-private-affirmative-tint": "false",
404 "sound-file": "dummy.ogg"},
427 "sound-file": "dummy.ogg"},
405 summary: "Cole Raby",
428 summary: "Cole Raby",
@@ -423,6 +446,7 @@ Item {
424 tag: "Ephemeral notification with non-shaped icon",
447 tag: "Ephemeral notification with non-shaped icon",
425 type: Notification.Ephemeral,
448 type: Notification.Ephemeral,
449+ id: mockModel.getNextId(),
426 hints: {"x-canonical-private-affirmative-tint": "false",
450 hints: {"x-canonical-private-affirmative-tint": "false",
427 "x-canonical-non-shaped-icon": "true"},
451 "x-canonical-non-shaped-icon": "true"},
428 summary: "Contacts",
452 summary: "Contacts",
@@ -446,6 +470,7 @@ Item {
447 tag: "Confirmation notification with value",
471 tag: "Confirmation notification with value",
448 type: Notification.Confirmation,
472 type: Notification.Confirmation,
473+ id: mockModel.getNextId(),
449 hints: {"x-canonical-non-shaped-icon": "true"},
474 hints: {"x-canonical-non-shaped-icon": "true"},
450 summary: "",
475 summary: "",
451 body: "",
476 body: "",
@@ -469,6 +494,7 @@ Item {
470 tag: "Confirmation notification with value, label and tint",
495 tag: "Confirmation notification with value, label and tint",
471 type: Notification.Confirmation,
496 type: Notification.Confirmation,
497+ id: mockModel.getNextId(),
472 hints: {"x-canonical-non-shaped-icon": "true",
498 hints: {"x-canonical-non-shaped-icon": "true",
473 "x-canonical-value-bar-tint" : "true"},
499 "x-canonical-value-bar-tint" : "true"},
474 summary: "",
500 summary: "",