/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
***************************************************************************/
#include <QFileDialog>
+#include <QUrl>
#include <phonon/mediaobject.h>
#include <phonon/backendcapabilities.h>
: 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();
}
return;
}
- _media = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(file));
+ _media = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(file)));
}
if (audioPreview)
delete audioPreview;
- audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(ui.filename->text()));
+ audioPreview = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(ui.filename->text())));
audioPreview->play();
}
}