on xenial help sign in
Stripped down the mocked notification-model for the qmltest even more, but appending still doesn't seem to work.
1580041Mirco Müller
qml/Notifications/Notification.qml−1
@@ -86,7 +86,6 @@ Item {
86
86
87 // FIXME: using onCompleted because of LP: #1354406 workaround, has to be onOpacityChanged really
87 // FIXME: using onCompleted because of LP: #1354406 workaround, has to be onOpacityChanged really
88 Component.onCompleted: {
88 Component.onCompleted: {
89− print("Added notification with summary:", summary)
90 if (opacity == 1.0 && hints["suppress-sound"] !== "true" && sound.source !== "") {
89 if (opacity == 1.0 && hints["suppress-sound"] !== "true" && sound.source !== "") {
91 sound.play();
90 sound.play();
92 }
91 }
tests/qmltests/Notifications/tst_Notifications.qml+7−28
@@ -118,16 +118,11 @@ Item {
118 Row {
118 Row {
119 id: rootRow
119 id: rootRow
120
120
121− ListModel {
121+ NotificationModel {
122 id: mockModel
122 id: mockModel
123− dynamicRoles: true
124
123
125 signal actionInvoked(string actionId)
124 signal actionInvoked(string actionId)
126
125
127− function getRaw(id) {
128− return dataList[id]
129− }
130−
131 // add the default/PlaceHolder notification to the model
126 // add the default/PlaceHolder notification to the model
132 Component.onCompleted: {
127 Component.onCompleted: {
133 append(dataList[0])
128 append(dataList[0])
@@ -135,47 +130,31 @@ Item {
135 }
130 }
136
131
137 function add2over1SnapDecisionNotification() {
132 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−
154 //mockModel.append(dataList[1])
133 //mockModel.append(dataList[1])
155 }
134 }
156
135
157 function addEphemeralNotification() {
136 function addEphemeralNotification() {
158− mockModel.append(dataList[2])
137+ //mockModel.append(dataList[2])
159 }
138 }
160
139
161 function addEphemeralNonShapedIconNotification() {
140 function addEphemeralNonShapedIconNotification() {
162− mockModel.append(dataList[3])
141+ //mockModel.append(dataList[3])
163 }
142 }
164
143
165 function addEphemeralIconSummaryNotification() {
144 function addEphemeralIconSummaryNotification() {
166− mockModel.append(dataList[4])
145+ //mockModel.append(dataList[4])
167 }
146 }
168
147
169 function addInteractiveNotification() {
148 function addInteractiveNotification() {
170− mockModel.append(dataList[5])
149+ //mockModel.append(dataList[5])
171 }
150 }
172
151
173 function addConfirmationNotification() {
152 function addConfirmationNotification() {
174− mockModel.append(dataList[6])
153+ //mockModel.append(dataList[6])
175 }
154 }
176
155
177 function add2ndConfirmationNotification() {
156 function add2ndConfirmationNotification() {
178− mockModel.append(dataList[7])
157+ //mockModel.append(dataList[7])
179 }
158 }
180
159
181 function clearNotifications() {
160 function clearNotifications() {