/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef PHONONNOTIFICATIONBACKEND_H_
-#define PHONONNOTIFICATIONBACKEND_H_
+#pragma once
+
+#include <memory>
#include <QMediaPlayer>
Q_OBJECT
public:
- QtMultimediaNotificationBackend(QObject *parent = 0);
- ~QtMultimediaNotificationBackend();
+ QtMultimediaNotificationBackend(QObject *parent = nullptr);
- void notify(const Notification &);
- void close(uint notificationId);
- virtual SettingsPage *createConfigWidget() const;
+ void notify(const Notification &) override;
+ void close(uint notificationId) override;
+ SettingsPage *createConfigWidget() const override;
private slots:
void enabledChanged(const QVariant &);
class ConfigWidget;
bool _enabled;
- QMediaPlayer *_media;
+ std::unique_ptr<QMediaPlayer> _media;
};
Q_OBJECT
public:
- ConfigWidget(QWidget *parent = 0);
- ~ConfigWidget();
+ ConfigWidget(QWidget *parent = nullptr);
- void save();
- void load();
- bool hasDefaults() const;
- void defaults();
+ void save() override;
+ void load() override;
+ bool hasDefaults() const override;
+ void defaults() override;
private slots:
void widgetChanged();
private:
Ui::QtMultimediaNotificationConfigWidget ui;
- bool enabled;
+ bool _enabled;
bool _audioAvailable;
- QString filename;
- QMediaPlayer *audioPreview;
+ QString _filename;
+ std::unique_ptr<QMediaPlayer> _audioPreview;
};
-
-
-#endif