on xenial help sign in
Stripped down the mocked notification-model for the qmltest even more, but appending still doesn't seem to work.
commit1580041bc0d6122364086706af3d69a17c1f661e authorMirco Müller <mirco.mueller@ubuntu.com> dateTue 13 Jan 2015, 16:26 (12 years ago) parentf3279b6
2 files changed+7−29
qml/Notifications/Notification.qml−1 tests/qmltests/Notifications/tst_Notifications.qml+7−28
qml/Notifications/Notification.qml−1
@@ -86,7 +86,6 @@ Item {
8686
8787 // FIXME: using onCompleted because of LP: #1354406 workaround, has to be onOpacityChanged really
8888 Component.onCompleted: {
89− print("Added notification with summary:", summary)
9089 if (opacity == 1.0 && hints["suppress-sound"] !== "true" && sound.source !== "") {
9190 sound.play();
9291 }
tests/qmltests/Notifications/tst_Notifications.qml+7−28
@@ -118,16 +118,11 @@ Item {
118118 Row {
119119 id: rootRow
120120
121− ListModel {
121+ NotificationModel {
122122 id: mockModel
123− dynamicRoles: true
124123
125124 signal actionInvoked(string actionId)
126125
127− function getRaw(id) {
128− return dataList[id]
129− }
130−
131126 // add the default/PlaceHolder notification to the model
132127 Component.onCompleted: {
133128 append(dataList[0])
@@ -135,47 +130,31 @@ Item {
135130 }
136131
137132 function add2over1SnapDecisionNotification() {
138− var n = {
139− type: Notification.SnapDecision,
140− hints: {"x-canonical-private-affirmative-tint": "true"},
141− summary: "Incoming call",
142− body: "Frank Zappa\n+44 (0)7736 027340",
143− icon: "../graphics/avatars/funky.png",
144− secondaryIcon: "image://theme/incoming-call",
145− actions: [{ id: "ok_id", label: "Ok"},
146− { id: "cancel_id", label: "Cancel"},
147− { id: "dummy_id", label: "Quick reply"},
148− { id: "late_id", label: "messages:I'm running late. I'm on my way."},
149− { id: "later_id", label: "messages:I'm busy at the moment. I'll call later."}]
150− }
151−
152− mockModel.append(n)
153−
154133 //mockModel.append(dataList[1])
155134 }
156135
157136 function addEphemeralNotification() {
158− mockModel.append(dataList[2])
137+ //mockModel.append(dataList[2])
159138 }
160139
161140 function addEphemeralNonShapedIconNotification() {
162− mockModel.append(dataList[3])
141+ //mockModel.append(dataList[3])
163142 }
164143
165144 function addEphemeralIconSummaryNotification() {
166− mockModel.append(dataList[4])
145+ //mockModel.append(dataList[4])
167146 }
168147
169148 function addInteractiveNotification() {
170− mockModel.append(dataList[5])
149+ //mockModel.append(dataList[5])
171150 }
172151
173152 function addConfirmationNotification() {
174− mockModel.append(dataList[6])
153+ //mockModel.append(dataList[6])
175154 }
176155
177156 function add2ndConfirmationNotification() {
178− mockModel.append(dataList[7])
157+ //mockModel.append(dataList[7])
179158 }
180159
181160 function clearNotifications() {