diff options
author | Andreas Sturmlechner <andreas.sturmlechner@gmail.com> | 2016-10-22 23:09:00 +0200 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2016-11-06 02:42:50 +1100 |
commit | 54401847549e3a5ad53811646e63b69327a57376 (patch) | |
tree | d4db21c72d5d4987310fb61e5f482b5cf648ac85 /media-sound/cantata/files | |
parent | app-admin/qtpass: Version bump to 1.1.5 and add 9999 (diff) | |
download | gentoo-54401847549e3a5ad53811646e63b69327a57376.tar.gz gentoo-54401847549e3a5ad53811646e63b69327a57376.tar.bz2 gentoo-54401847549e3a5ad53811646e63b69327a57376.zip |
media-sound/cantata: Drop USE=kde,qt5 and simplify ebuild
Add fixes for MPRIS and >=Plasma-5.7
X not used with Qt5 - upstream commit c934ae9ed5b8aeb3d8ff6a6b108b3cfe4fb30dea
Package-Manager: portage-2.3.0
Diffstat (limited to 'media-sound/cantata/files')
3 files changed, 160 insertions, 0 deletions
diff --git a/media-sound/cantata/files/cantata-2.0.1-mpris-plasma57.patch b/media-sound/cantata/files/cantata-2.0.1-mpris-plasma57.patch new file mode 100644 index 000000000000..3965b425a938 --- /dev/null +++ b/media-sound/cantata/files/cantata-2.0.1-mpris-plasma57.patch @@ -0,0 +1,46 @@ +Work-around KDE 5.7 MPRIS issues. + +diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp +index cc2b532..37eec9e 100644 +--- a/gui/mainwindow.cpp ++++ b/gui/mainwindow.cpp +@@ -1410,8 +1410,8 @@ void MainWindow::setRating() + } + } + +-void MainWindow::readSettings() +-{ ++void MainWindow::initMpris() ++{ + #ifdef QT_QTDBUS_FOUND + if (Settings::self()->mpris()) { + if (!mpris) { +@@ -1424,6 +1424,16 @@ void MainWindow::readSettings() + mpris=0; + } + CurrentCover::self()->setEnabled(mpris || Settings::self()->showPopups() || 0!=Settings::self()->playQueueBackground() || Settings::self()->showCoverWidget()); ++ #endif ++} ++ ++void MainWindow::readSettings() ++{ ++ #ifdef QT_QTDBUS_FOUND ++ // It appears as if the KDE MPRIS code does not like the MPRIS interface to be setup before the window is visible. ++ // to work-around this, initMpris in the next event loop iteration. ++ // See #863 ++ QTimer::singleShot(0, this, SLOT(initMpris())); + #else + CurrentCover::self()->setEnabled(Settings::self()->showPopups() || 0!=Settings::self()->playQueueBackground() || Settings::self()->showCoverWidget()); + #endif +diff --git a/gui/mainwindow.h b/gui/mainwindow.h +index 6d6e960..aa3a80a 100644 +--- a/gui/mainwindow.h ++++ b/gui/mainwindow.h +@@ -268,6 +268,7 @@ public Q_SLOTS: + private Q_SLOTS: + void toggleContext(); + void toggleMenubar(); ++ void initMpris(); + + private: + int prevPage; diff --git a/media-sound/cantata/files/cantata-2.0.1-mpris-true.patch b/media-sound/cantata/files/cantata-2.0.1-mpris-true.patch new file mode 100644 index 000000000000..c32f745b82f7 --- /dev/null +++ b/media-sound/cantata/files/cantata-2.0.1-mpris-true.patch @@ -0,0 +1,100 @@ +Always return true for MPRIS CanPlay, CanPause, etc. + +diff --git a/dbus/mpris.cpp b/dbus/mpris.cpp +index 4736d19..45a539a 100644 +--- a/dbus/mpris.cpp ++++ b/dbus/mpris.cpp +@@ -65,6 +65,31 @@ Mpris::~Mpris() + QDBusConnection::sessionBus().unregisterService("org.mpris.MediaPlayer2.cantata"); + } + ++void Mpris::Pause() ++{ ++ if (MPDState_Playing==MPDStatus::self()->state()) { ++ StdActions::self()->playPauseTrackAction->trigger(); ++ } ++} ++ ++void Mpris::Play() ++{ ++ MPDStatus * const status = MPDStatus::self(); ++ if (status->playlistLength() && MPDState_Playing!=status->state()) { ++ StdActions::self()->playPauseTrackAction->trigger(); ++ } ++} ++ ++QString Mpris::PlaybackStatus() const ++{ ++ switch(MPDStatus::self()->state()) { ++ case MPDState_Playing: return QLatin1String("Playing"); ++ case MPDState_Paused: return QLatin1String("Paused"); ++ default: ++ case MPDState_Stopped: return QLatin1String("Stopped"); ++ } ++} ++ + qlonglong Mpris::Position() const + { + // Cant use MPDStatus, as we dont poll for track position, but use a timer instead! +diff --git a/dbus/mpris.h b/dbus/mpris.h +index 64a4fbe..a1578b9 100644 +--- a/dbus/mpris.h ++++ b/dbus/mpris.h +@@ -71,37 +71,15 @@ class Mpris : public QObject + // org.mpris.MediaPlayer2.Player + void Next() { StdActions::self()->nextTrackAction->trigger(); } + void Previous() { StdActions::self()->prevTrackAction->trigger(); } +- void Pause() { +- if (MPDState_Playing==MPDStatus::self()->state()) { +- StdActions::self()->playPauseTrackAction->trigger(); +- } +- } +- ++ void Pause(); + void PlayPause() { StdActions::self()->playPauseTrackAction->trigger(); } + void Stop() { StdActions::self()->stopPlaybackAction->trigger(); } + void StopAfterCurrent() { StdActions::self()->stopAfterCurrentTrackAction->trigger(); } +- +- void Play() { +- MPDStatus * const status = MPDStatus::self(); +- +- if (status->playlistLength() && MPDState_Playing!=status->state()) { +- StdActions::self()->playPauseTrackAction->trigger(); +- } +- } +- ++ void Play(); + void Seek(qlonglong pos) { emit setSeekId(-1, pos/1000000); } + void SetPosition(const QDBusObjectPath &, qlonglong pos) {emit setSeekId(-1, pos/1000000); } + void OpenUri(const QString &) { } +- +- QString PlaybackStatus() { +- switch(MPDStatus::self()->state()) { +- case MPDState_Playing: return QLatin1String("Playing"); +- case MPDState_Paused: return QLatin1String("Paused"); +- default: +- case MPDState_Stopped: return QLatin1String("Stopped"); +- } +- } +- ++ QString PlaybackStatus() const; + QString LoopStatus() { return MPDStatus::self()->repeat() ? QLatin1String("Playlist") : QLatin1String("None"); } + void SetLoopStatus(const QString &s) { emit setRepeat(QLatin1String("None")!=s); } + QVariantMap Metadata() const; +@@ -115,11 +93,11 @@ class Mpris : public QObject + double MinimumRate() const { return 1.0; } + double MaximumRate() const { return 1.0; } + bool CanControl() const { return true; } +- bool CanPlay() const { return MPDState_Playing!=MPDStatus::self()->state() && MPDStatus::self()->playlistLength()>0; } +- bool CanPause() const { return MPDState_Playing==MPDStatus::self()->state(); } +- bool CanSeek() const { return -1!=MPDStatus::self()->songId(); } +- bool CanGoNext() const { return MPDState_Stopped!=MPDStatus::self()->state() && MPDStatus::self()->playlistLength()>1; } +- bool CanGoPrevious() const { return MPDState_Stopped!=MPDStatus::self()->state() && MPDStatus::self()->playlistLength()>1; } ++ bool CanPlay() const { return true; } ++ bool CanPause() const { return true; } ++ bool CanSeek() const { return true; } ++ bool CanGoNext() const { return true; } ++ bool CanGoPrevious() const { return true; } + + // org.mpris.MediaPlayer2 + bool CanQuit() const { return true; } diff --git a/media-sound/cantata/files/cantata-2.0.1-qt5-no-X11.patch b/media-sound/cantata/files/cantata-2.0.1-qt5-no-X11.patch new file mode 100644 index 000000000000..de90cd684509 --- /dev/null +++ b/media-sound/cantata/files/cantata-2.0.1-qt5-no-X11.patch @@ -0,0 +1,14 @@ +diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt +index fcdaf5c..f6160f0 100644 +--- a/support/CMakeLists.txt ++++ b/support/CMakeLists.txt +@@ -89,7 +89,7 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB) + + add_library(support STATIC ${SUPPORT_MOC_SRCS} ${SUPPORT_SRCS} ${SUPPORT_UI_HDRS} ${SUPPORT_RC_SRCS}) + +- if (X11_FOUND) ++ if (NOT ENABLE_QT5 AND X11_FOUND) + target_link_libraries(support ${X11_LIBRARIES}) +- endif (X11_FOUND) ++ endif (NOT ENABLE_QT5 AND X11_FOUND) + endif (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB) |