on xenial help sign in
Fixed issues from MP-comments.
dac7e67Mirco Müller
qml/Notifications/Notification.qml+4−4
@@ -70,12 +70,12 @@ Item {
70 Audio {
70 Audio {
71 id: sound
71 id: sound
72 objectName: "sound"
72 objectName: "sound"
73− source: hints["sound-file"]
73+ source: hints["suppress-sound"] != "" ? hints["sound-file"] : undefined
74 }
74 }
75
75
76− Component.onCompleted: {
76+ onVisibleChanged: {
77− if (hints["suppress-sound"] != "true") {
77+ if (visible == true && sound.source != undefined) {
78− sound.play ()
78+ sound.play()
79 }
79 }
80 }
80 }
81
81
tests/qmltests/Notifications/tst_Notifications.qml+5−5
@@ -272,7 +272,7 @@ Row {
272 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
272 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
273 type: Notification.Ephemeral,
273 type: Notification.Ephemeral,
274 hints: {"x-canonical-private-button-tint": "false",
274 hints: {"x-canonical-private-button-tint": "false",
275− "sound-file": "/usr/share/sounds/ubuntu/stereo/message.ogg",
275+ "sound-file": "dummy.ogg",
276 "suppress-sound": "true"},
276 "suppress-sound": "true"},
277 summary: "New comment successfully published",
277 summary: "New comment successfully published",
278 body: "",
278 body: "",
@@ -294,7 +294,7 @@ Row {
294 tag: "Interactive notification",
294 tag: "Interactive notification",
295 type: Notification.Interactive,
295 type: Notification.Interactive,
296 hints: {"x-canonical-private-button-tint": "false",
296 hints: {"x-canonical-private-button-tint": "false",
297− "sound-file": "/usr/share/sounds/ubuntu/stereo/message.ogg"},
297+ "sound-file": "dummy.ogg"},
298 summary: "Interactive notification",
298 summary: "Interactive notification",
299 body: "This is a notification that can be clicked",
299 body: "This is a notification that can be clicked",
300 icon: "../graphics/avatars/amanda.png",
300 icon: "../graphics/avatars/amanda.png",
@@ -314,7 +314,7 @@ Row {
314 tag: "Snap Decision without secondary icon and no button-tint",
314 tag: "Snap Decision without secondary icon and no button-tint",
315 type: Notification.SnapDecision,
315 type: Notification.SnapDecision,
316 hints: {"x-canonical-private-button-tint": "false",
316 hints: {"x-canonical-private-button-tint": "false",
317− "sound-file": "/usr/share/sounds/ubuntu/stereo/message.ogg"},
317+ "sound-file": "dummy.ogg"},
318 summary: "Bro Coly",
318 summary: "Bro Coly",
319 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
319 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
320 icon: "../graphics/avatars/anna_olsson.png",
320 icon: "../graphics/avatars/anna_olsson.png",
@@ -335,7 +335,7 @@ Row {
335 tag: "Ephemeral notification",
335 tag: "Ephemeral notification",
336 type: Notification.Ephemeral,
336 type: Notification.Ephemeral,
337 hints: {"x-canonical-private-button-tint": "false",
337 hints: {"x-canonical-private-button-tint": "false",
338− "sound-file": "/usr/share/sounds/ubuntu/stereo/message.ogg"},
338+ "sound-file": "dummy.ogg"},
339 summary: "Cole Raby",
339 summary: "Cole Raby",
340 body: "I did not expect it to be that late.",
340 body: "I did not expect it to be that late.",
341 icon: "../graphics/avatars/funky.png",
341 icon: "../graphics/avatars/funky.png",
@@ -356,7 +356,7 @@ Row {
356 type: Notification.Ephemeral,
356 type: Notification.Ephemeral,
357 hints: {"x-canonical-private-button-tint": "false",
357 hints: {"x-canonical-private-button-tint": "false",
358 "x-canonical-non-shaped-icon": "true",
358 "x-canonical-non-shaped-icon": "true",
359− "sound-file": "/usr/share/sounds/ubuntu/stereo/message.ogg"},
359+ "sound-file": "dummy.ogg"},
360 summary: "Contacts",
360 summary: "Contacts",
361 body: "Synchronised contacts-database with cloud-storage.",
361 body: "Synchronised contacts-database with cloud-storage.",
362 icon: "../graphics/applicationIcons/contacts-app.png",
362 icon: "../graphics/applicationIcons/contacts-app.png",