X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fphononnotificationbackend.cpp;h=bcc7c76d964605a2be30c13d33de9c34607e9409;hp=821507ce74cbce9007a7c0d04692f01b9e0d500f;hb=983c08ec7b6facf428ddc29deddb5fc46a44b10b;hpb=3e34b3310896abbef743a1edfcdcc3e46745b830 diff --git a/src/qtui/phononnotificationbackend.cpp b/src/qtui/phononnotificationbackend.cpp index 821507ce..bcc7c76d 100644 --- a/src/qtui/phononnotificationbackend.cpp +++ b/src/qtui/phononnotificationbackend.cpp @@ -20,8 +20,9 @@ #include -#include +#include #include + #include "phononnotificationbackend.h" #include "clientsettings.h" @@ -33,7 +34,7 @@ PhononNotificationBackend::PhononNotificationBackend(QObject *parent) : AbstractNotificationBackend(parent), _media(0) { - _audioAvailable = ! Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty() ; + _audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty(); NotificationSettings notificationSettings; _enabled = notificationSettings.value("Phonon/Enabled", true).toBool(); createMediaObject(notificationSettings.value("Phonon/AudioFile", QString()).toString()); @@ -97,8 +98,7 @@ void PhononNotificationBackend::createMediaObject(const QString &file) return; } - _media = Phonon::createPlayer(Phonon::NotificationCategory, - Phonon::MediaSource(file)); + _media = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(file)); } @@ -109,7 +109,7 @@ PhononNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) audioPreview(0) { ui.setupUi(this); - _audioAvailable = ! Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty() ; + _audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty(); ui.enabled->setIcon(SmallIcon("media-playback-start")); ui.play->setIcon(SmallIcon("media-playback-start")); ui.open->setIcon(SmallIcon("document-open")); @@ -128,21 +128,19 @@ PhononNotificationBackend::ConfigWidget::~ConfigWidget() void PhononNotificationBackend::ConfigWidget::widgetChanged() { - if ( ! _audioAvailable ) - { - ui.play->setEnabled( ui.enabled->isChecked() ); - ui.open->setEnabled( false ); - ui.filename->setEnabled( false ); - ui.filename->setText( QString() ); + if (! _audioAvailable) { + ui.play->setEnabled(ui.enabled->isChecked()); + ui.open->setEnabled(false); + ui.filename->setEnabled(false); + ui.filename->setText(QString()); } - else - { + else { ui.play->setEnabled(ui.enabled->isChecked() && !ui.filename->text().isEmpty()); - bool changed = (enabled != ui.enabled->isChecked() - || filename != ui.filename->text()); + bool changed = (enabled != ui.enabled->isChecked() || filename != ui.filename->text()); - if (changed != hasChanged()) setChangedState(changed); + if (changed != hasChanged()) + setChangedState(changed); } } @@ -201,8 +199,7 @@ void PhononNotificationBackend::ConfigWidget::on_play_clicked() if (audioPreview) delete audioPreview; - audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, - Phonon::MediaSource(ui.filename->text())); + audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(ui.filename->text())); audioPreview->play(); } }