From: Manuel Nickschas Date: Tue, 19 Nov 2013 21:59:47 +0000 (+0100) Subject: Fix the Phonon notification backend not playing any sound X-Git-Tag: 0.10-beta1~100 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=244c5c3f473eaf3c354a60348ddc668428181b8a;ds=sidebyside Fix the Phonon notification backend not playing any sound Phonon won't report its capabilities before a player has been created, which leads to Quassel thinking that it can't play audio since we checked for that before instantiating the player. Some reordering in the ctor fixes this. --- diff --git a/src/qtui/phononnotificationbackend.cpp b/src/qtui/phononnotificationbackend.cpp index 8bd7020d..b4adc1c2 100644 --- a/src/qtui/phononnotificationbackend.cpp +++ b/src/qtui/phononnotificationbackend.cpp @@ -34,13 +34,14 @@ PhononNotificationBackend::PhononNotificationBackend(QObject *parent) : AbstractNotificationBackend(parent), _media(0) { - _audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty(); NotificationSettings notificationSettings; - _enabled = notificationSettings.value("Phonon/Enabled", true).toBool(); - createMediaObject(notificationSettings.value("Phonon/AudioFile", QString()).toString()); - notificationSettings.notify("Phonon/Enabled", this, SLOT(enabledChanged(const QVariant &))); notificationSettings.notify("Phonon/AudioFile", this, SLOT(audioFileChanged(const QVariant &))); + + createMediaObject(notificationSettings.value("Phonon/AudioFile", QString()).toString()); + + _enabled = notificationSettings.value("Phonon/Enabled", true).toBool(); + _audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty(); }