Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 666f4646 authored by Laurent Montel's avatar Laurent Montel 😁

Remove obsolete phonon support

parent cad8b4fc
......@@ -37,7 +37,7 @@ set(PIMCOMMON_LIB_VERSION "5.10.80")
set(AKONADI_VERSION "5.10.80")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Test Xml)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Test Xml Multimedia)
find_package(KF5Archive ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
......@@ -67,7 +67,6 @@ find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)
find_package(KF5DesignerPlugin ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5DesignerPlugin PROPERTIES DESCRIPTION "KF5 designer plugin" TYPE OPTIONAL)
......
......@@ -239,7 +239,6 @@ PRIVATE
KF5::Mime
KF5::Codecs
KF5::MailTransport
Phonon::phonon4qt5
KF5::XmlGui
KF5::KIOWidgets
KF5::WindowSystem
......@@ -247,6 +246,7 @@ PRIVATE
KF5::Archive
KF5::ItemViews
KF5::SyntaxHighlighting
Qt5::Multimedia
)
......
set(mailcommon_filter_test_LIBS Qt5::Test Qt5::Gui KF5::AkonadiCore KF5::AkonadiMime
KF5::LibkdepimAkonadi KF5::MailCommon KF5::PimCommon Phonon::phonon4qt5
KF5::LibkdepimAkonadi KF5::MailCommon KF5::PimCommon Qt5::Multimedia
KF5::KIOWidgets KF5::IconThemes KF5::TemplateParser
KF5::MailTransport KF5::I18n KF5::SyntaxHighlighting
)
......
......@@ -21,10 +21,9 @@
#include "filter/dialog/filteractionmissingsoundurldialog.h"
#include <phonon/mediaobject.h>
#include <KLocalizedString>
#include <QMediaPlayer>
#include <QFile>
#include <QPointer>
......@@ -57,10 +56,11 @@ FilterAction::ReturnCode FilterActionPlaySound::process(ItemContext &, bool) con
return ErrorButGoOn;
}
if (!mPlayer) {
mPlayer = Phonon::createPlayer(Phonon::NotificationCategory);
mPlayer = new QMediaPlayer;
}
mPlayer->setCurrentSource(mParameter);
mPlayer->setMedia(QUrl::fromLocalFile(mParameter));
mPlayer->setVolume(50);
mPlayer->play();
return GoOn;
}
......
......@@ -21,10 +21,7 @@
#define MAILCOMMON_FILTERACTIONPLAYSOUND_H
#include "filteractionwithtest.h"
namespace Phonon {
class MediaObject;
}
class QMediaPlayer;
namespace MailCommon {
//=============================================================================
......@@ -45,7 +42,7 @@ public:
Q_REQUIRED_RESULT bool isEmpty() const override;
Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
private:
mutable Phonon::MediaObject *mPlayer = nullptr;
mutable QMediaPlayer *mPlayer = nullptr;
};
}
......
......@@ -24,11 +24,10 @@
#include <KLineEdit>
#include <QIcon>
#include <QUrl>
#include <QMediaPlayer>
#include <QHBoxLayout>
#include <QPushButton>
#include <phonon/mediaobject.h>
#include <QStandardPaths>
using namespace MailCommon;
......@@ -113,9 +112,15 @@ void SoundTestWidget::playSound()
const QString play = (parameter.startsWith(file)
? parameter.mid(file.length())
: parameter);
Phonon::MediaObject *player = Phonon::createPlayer(Phonon::NotificationCategory, QUrl::fromLocalFile(play));
QMediaPlayer *player = new QMediaPlayer;
player->setMedia(QUrl::fromLocalFile(play));
player->setVolume(50);
player->play();
connect(player, &Phonon::MediaObject::finished, player, &Phonon::MediaObject::deleteLater);
connect(player, &QMediaPlayer::stateChanged, this, [this, player](QMediaPlayer::State state) {
if (state == QMediaPlayer::StoppedState) {
player->deleteLater();
}
});
}
QString SoundTestWidget::url() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment