#include <QFileDialog>
#include <QUrl>
+#include <memory>
#include "clientsettings.h"
#include "icon.h"
: AbstractNotificationBackend(parent)
{
NotificationSettings notificationSettings;
- notificationSettings.notify("QtMultimedia/Enabled", this, SLOT(enabledChanged(const QVariant &)));
- notificationSettings.notify("QtMultimedia/AudioFile", this, SLOT(audioFileChanged(const QVariant &)));
+ notificationSettings.notify("QtMultimedia/Enabled", this, &QtMultimediaNotificationBackend::enabledChanged);
+ notificationSettings.notify("QtMultimedia/AudioFile", this, &QtMultimediaNotificationBackend::audioFileChanged);
createMediaObject(notificationSettings.value("QtMultimedia/AudioFile", QString()).toString());
return;
}
- _media.reset(new QMediaPlayer);
+ _media = std::make_unique<QMediaPlayer>();
_media->setMedia(QUrl::fromLocalFile(file));
}
_audioAvailable = (QMediaPlayer().availability() == QMultimedia::Available);
- connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
- connect(ui.filename, SIGNAL(textChanged(const QString &)), SLOT(widgetChanged()));
+ connect(ui.enabled, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
+ connect(ui.filename, &QLineEdit::textChanged, this, &ConfigWidget::widgetChanged);
}
{
if (_audioAvailable) {
if (!ui.filename->text().isEmpty()) {
- _audioPreview.reset(new QMediaPlayer);
+ _audioPreview = std::make_unique<QMediaPlayer>();
_audioPreview->setMedia(QUrl::fromLocalFile(ui.filename->text()));
_audioPreview->play();
}