diff --git a/src/libtomahawk/playlist/GridItemDelegate.cpp b/src/libtomahawk/playlist/GridItemDelegate.cpp index 6110608bc..a79104a96 100644 --- a/src/libtomahawk/playlist/GridItemDelegate.cpp +++ b/src/libtomahawk/playlist/GridItemDelegate.cpp @@ -459,6 +459,8 @@ GridItemDelegate::onPlaybackFinished() foreach ( ImageButton* button, m_pauseButton ) button->deleteLater(); m_pauseButton.clear(); + + emit stoppedPlaying( QModelIndex() ); } @@ -501,6 +503,8 @@ GridItemDelegate::onPlaylistChanged( const QPersistentModelIndex& index ) m_spinner[ index ]->deleteLater(); m_spinner.remove( index ); } + + emit stoppedPlaying( index ); } } } @@ -532,6 +536,8 @@ GridItemDelegate::onPlaybackStarted( const QPersistentModelIndex& index ) connect( button, SIGNAL( clicked( bool ) ), AudioEngine::instance(), SLOT( playPause() ) ); m_pauseButton[ index ] = button; + + emit startedPlaying( index ); } diff --git a/src/libtomahawk/playlist/GridItemDelegate.h b/src/libtomahawk/playlist/GridItemDelegate.h index b05b171a3..a14414715 100644 --- a/src/libtomahawk/playlist/GridItemDelegate.h +++ b/src/libtomahawk/playlist/GridItemDelegate.h @@ -58,6 +58,9 @@ protected: signals: void updateIndex( const QModelIndex& idx ); + void startedPlaying( const QPersistentModelIndex& ); + void stoppedPlaying( const QPersistentModelIndex& ); + private slots: void modelChanged(); void doUpdateIndex( const QPersistentModelIndex& idx ); diff --git a/src/libtomahawk/playlist/GridView.cpp b/src/libtomahawk/playlist/GridView.cpp index 0b0197f2c..bccd83657 100644 --- a/src/libtomahawk/playlist/GridView.cpp +++ b/src/libtomahawk/playlist/GridView.cpp @@ -34,6 +34,7 @@ #include "GridItemDelegate.h" #include "AlbumModel.h" #include "PlayableModel.h" +#include "PlayableProxyModelPlaylistInterface.h" #include "ContextMenu.h" #include "ViewManager.h" #include "utils/Logger.h" @@ -44,6 +45,32 @@ using namespace Tomahawk; +class GridPlaylistInterface : public PlayableProxyModelPlaylistInterface { + Q_OBJECT +public: + explicit GridPlaylistInterface( PlayableProxyModel* proxy, GridView* view ) : PlayableProxyModelPlaylistInterface( proxy ), m_view( view ) {} + + virtual bool hasChildInterface( playlistinterface_ptr playlistInterface ) + { + if ( m_view.isNull() || !m_view.data()->m_playing.isValid() ) + { + return false; + } + + PlayableItem* item = m_view.data()->model()->itemFromIndex( m_view.data()->proxyModel()->mapToSource( m_view.data()->m_playing ) ); + if ( item ) + { + if ( !item->album().isNull() ) + return item->album()->playlistInterface( Tomahawk::Mixed ) == playlistInterface; + else if ( !item->artist().isNull() ) + return item->artist()->playlistInterface( Tomahawk::Mixed ) == playlistInterface; + } + + return false; + } +private: + QWeakPointer m_view; +}; GridView::GridView( QWidget* parent ) : QListView( parent ) @@ -77,6 +104,8 @@ GridView::GridView( QWidget* parent ) setAutoResize( false ); setProxyModel( new PlayableProxyModel( this ) ); + m_playlistInterface = playlistinterface_ptr( new GridPlaylistInterface( m_proxyModel, this ) ); + connect( this, SIGNAL( doubleClicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) ); connect( this, SIGNAL( customContextMenuRequested( QPoint ) ), SLOT( onCustomContextMenu( QPoint ) ) ); @@ -103,6 +132,8 @@ GridView::setProxyModel( PlayableProxyModel* model ) m_delegate = new GridItemDelegate( this, m_proxyModel ); connect( m_delegate, SIGNAL( updateIndex( QModelIndex ) ), this, SLOT( update( QModelIndex ) ) ); + connect( m_delegate, SIGNAL( startedPlaying( QPersistentModelIndex ) ), this, SLOT( onDelegatePlaying( QPersistentModelIndex ) ) ); + connect( m_delegate, SIGNAL( stoppedPlaying( QPersistentModelIndex ) ), this, SLOT( onDelegateStopped( QPersistentModelIndex ) ) ); setItemDelegate( m_delegate ); QListView::setModel( m_proxyModel ); @@ -238,6 +269,21 @@ GridView::verifySize() } +void +GridView::onDelegatePlaying( const QPersistentModelIndex& index ) +{ + m_playing = index; +} + + +void +GridView::onDelegateStopped( const QPersistentModelIndex& index ) +{ + if ( m_playing == index ) + m_playing = QPersistentModelIndex(); +} + + void GridView::layoutItems() { @@ -356,3 +402,16 @@ GridView::setFilter( const QString& filter ) m_proxyModel->setFilter( filter ); return true; } + +bool +GridView::jumpToCurrentTrack() +{ + if ( !m_playing.isValid() ) + return false; + + scrollTo( m_playing, QListView::PositionAtCenter ); + + return true; +} + +#include "GridView.moc" diff --git a/src/libtomahawk/playlist/GridView.h b/src/libtomahawk/playlist/GridView.h index 7003f0573..56bce3332 100644 --- a/src/libtomahawk/playlist/GridView.h +++ b/src/libtomahawk/playlist/GridView.h @@ -37,6 +37,7 @@ namespace Tomahawk class AnimatedSpinner; class GridItemDelegate; class PlayableModel; +class GridPlaylistInterface; class DLLEXPORT GridView : public QListView, public Tomahawk::ViewPage { @@ -64,13 +65,15 @@ public: void setEmptyTip( const QString& tip ); virtual QWidget* widget() { return this; } - virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->playlistInterface(); } + virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return m_playlistInterface; } virtual QString title() const { return m_model->title(); } virtual QString description() const { return m_model->description(); } virtual bool setFilter( const QString& filter ); - virtual bool jumpToCurrentTrack() { return false; } + virtual bool jumpToCurrentTrack(); + + virtual bool isBeingPlayed() const { return m_playing.isValid(); } public slots: void onItemActivated( const QModelIndex& index ); @@ -94,6 +97,9 @@ private slots: void onFilterChanged( const QString& filter ); void onCustomContextMenu( const QPoint& pos ); + void onDelegatePlaying( const QPersistentModelIndex& idx ); + void onDelegateStopped( const QPersistentModelIndex& idx ); + void layoutItems(); void verifySize(); @@ -103,8 +109,11 @@ private: GridItemDelegate* m_delegate; AnimatedSpinner* m_loadingSpinner; OverlayWidget* m_overlay; + Tomahawk::playlistinterface_ptr m_playlistInterface; QModelIndex m_contextMenuIndex; + QPersistentModelIndex m_playing; + Tomahawk::ContextMenu* m_contextMenu; QString m_emptyTip; @@ -113,6 +122,8 @@ private: bool m_autoResize; QRect m_paintRect; + + friend ::GridPlaylistInterface; }; #endif // GRIDVIEW_H diff --git a/src/libtomahawk/widgets/WelcomeWidget.cpp b/src/libtomahawk/widgets/WelcomeWidget.cpp index 7456233d2..37f80611e 100644 --- a/src/libtomahawk/widgets/WelcomeWidget.cpp +++ b/src/libtomahawk/widgets/WelcomeWidget.cpp @@ -43,6 +43,54 @@ using namespace Tomahawk; +class WelcomeWidgetInterface : public Tomahawk::PlaylistInterface +{ + Q_OBJECT +public: + explicit WelcomeWidgetInterface( WelcomeWidget* w ) + : PlaylistInterface() + , m_w( w ) + { + connect( m_w->ui->tracksView->proxyModel()->playlistInterface().data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ), + SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ) ); + + connect( m_w->ui->tracksView->proxyModel()->playlistInterface().data(), SIGNAL( shuffleModeChanged( bool ) ), + SIGNAL( shuffleModeChanged( bool ) ) ); + } + virtual ~WelcomeWidgetInterface() {} + + + virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->repeatMode(); } + virtual bool shuffled() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->shuffled(); } + + virtual Tomahawk::result_ptr currentItem() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->currentItem(); } + virtual Tomahawk::result_ptr siblingItem( int itemsAway ) { return m_w->ui->tracksView->proxyModel()->playlistInterface()->siblingItem( itemsAway ); } + virtual int trackCount() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->trackCount(); } + virtual QList< Tomahawk::query_ptr > tracks() { return m_w->ui->tracksView->proxyModel()->playlistInterface()->tracks(); } + + virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr other ) + { + return m_w->ui->tracksView->proxyModel()->playlistInterface() == other || + m_w->ui->tracksView->proxyModel()->playlistInterface()->hasChildInterface( other ) || + m_w->ui->additionsView->playlistInterface()->hasChildInterface( other ); + } + + virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode ) + { + m_w->ui->tracksView->proxyModel()->playlistInterface()->setRepeatMode( mode ); + } + + virtual void setShuffled( bool enabled ) + { + m_w->ui->tracksView->proxyModel()->playlistInterface()->setShuffled( enabled ); + } + +private: + WelcomeWidget* m_w; + +}; + + WelcomeWidget::WelcomeWidget( QWidget* parent ) : QWidget( parent ) , ui( new Ui::WelcomeWidget ) @@ -78,6 +126,8 @@ WelcomeWidget::WelcomeWidget( QWidget* parent ) ui->additionsView->setPlayableModel( m_recentAlbumsModel ); ui->additionsView->proxyModel()->sort( -1 ); + m_playlistInterface = playlistinterface_ptr( new WelcomeWidgetInterface( this ) ); + connect( SourceList::instance(), SIGNAL( ready() ), SLOT( onSourcesReady() ) ); connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) ); connect( ui->playlistWidget, SIGNAL( activated( QModelIndex ) ), SLOT( onPlaylistActivated( QModelIndex ) ) ); @@ -101,20 +151,29 @@ WelcomeWidget::loadData() Tomahawk::playlistinterface_ptr WelcomeWidget::playlistInterface() const { - return ui->tracksView->playlistInterface(); + return m_playlistInterface; } bool WelcomeWidget::jumpToCurrentTrack() { - return ui->tracksView->jumpToCurrentTrack(); + if ( ui->tracksView->jumpToCurrentTrack() ) + return true; + + if ( ui->additionsView->jumpToCurrentTrack() ) + return true; + + return false; } bool WelcomeWidget::isBeingPlayed() const { + if ( ui->additionsView->isBeingPlayed() ) + return true; + return AudioEngine::instance()->currentTrackPlaylist() == ui->tracksView->playlistInterface(); } @@ -320,3 +379,4 @@ PlaylistWidget::setModel( QAbstractItemModel* model ) emit modelChanged(); } +#include "WelcomeWidget.moc" diff --git a/src/libtomahawk/widgets/WelcomeWidget.h b/src/libtomahawk/widgets/WelcomeWidget.h index 5233f1594..e941f055f 100644 --- a/src/libtomahawk/widgets/WelcomeWidget.h +++ b/src/libtomahawk/widgets/WelcomeWidget.h @@ -37,6 +37,7 @@ class AlbumModel; class RecentlyPlayedModel; class OverlayWidget; +class WelcomeWidgetInterface; namespace Ui { @@ -125,6 +126,9 @@ private: RecentlyPlayedModel* m_tracksModel; AlbumModel* m_recentAlbumsModel; + Tomahawk::playlistinterface_ptr m_playlistInterface; + + friend class ::WelcomeWidgetInterface; }; #endif // WELCOMEWIDGET_H diff --git a/src/libtomahawk/widgets/WhatsHotWidget.cpp b/src/libtomahawk/widgets/WhatsHotWidget.cpp index 8dba1e009..b064c46f1 100644 --- a/src/libtomahawk/widgets/WhatsHotWidget.cpp +++ b/src/libtomahawk/widgets/WhatsHotWidget.cpp @@ -130,6 +130,9 @@ WhatsHotWidget::isBeingPlayed() const if ( AudioEngine::instance()->currentTrackPlaylist() == ui->tracksViewLeft->playlistInterface() ) return true; + if ( ui->albumsView->isBeingPlayed() ) + return true; + return false; } @@ -137,10 +140,13 @@ WhatsHotWidget::isBeingPlayed() const bool WhatsHotWidget::jumpToCurrentTrack() { - if ( ui->artistsViewLeft->jumpToCurrentTrack() ) + if ( ui->artistsViewLeft->model() && ui->artistsViewLeft->jumpToCurrentTrack() ) return true; - if ( ui->tracksViewLeft->jumpToCurrentTrack() ) + if ( ui->tracksViewLeft->model() && ui->tracksViewLeft->jumpToCurrentTrack() ) + return true; + + if ( ui->albumsView->model() && ui->albumsView->jumpToCurrentTrack() ) return true; return false; diff --git a/src/libtomahawk/widgets/WhatsHotWidget_p.h b/src/libtomahawk/widgets/WhatsHotWidget_p.h index e75d4aa62..8be446db3 100644 --- a/src/libtomahawk/widgets/WhatsHotWidget_p.h +++ b/src/libtomahawk/widgets/WhatsHotWidget_p.h @@ -65,7 +65,8 @@ public: virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr other ) { return m_w->ui->tracksViewLeft->playlistInterface() == other || - m_w->ui->artistsViewLeft->playlistInterface() == other; + m_w->ui->artistsViewLeft->playlistInterface() == other || + m_w->ui->albumsView->playlistInterface()->hasChildInterface( other ); } diff --git a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp index 442a25977..bacbc1902 100644 --- a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp @@ -20,6 +20,7 @@ #include "AlbumInfoWidget.h" #include "ui_AlbumInfoWidget.h" +#include "AlbumInfoWidget_p.h" #include "audio/AudioEngine.h" #include "ViewManager.h" @@ -61,6 +62,7 @@ AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* par m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultAlbumCover, TomahawkUtils::ScaledCover, QSize( 48, 48 ) ); + m_playlistInterface = playlistinterface_ptr( new MetaAlbumInfoInterface( this ) ); load( album ); } @@ -74,7 +76,7 @@ AlbumInfoWidget::~AlbumInfoWidget() Tomahawk::playlistinterface_ptr AlbumInfoWidget::playlistInterface() const { - return ui->tracksView->playlistInterface(); + return m_playlistInterface; } @@ -84,6 +86,10 @@ AlbumInfoWidget::isBeingPlayed() const //tDebug() << Q_FUNC_INFO << "audioengine playlistInterface = " << AudioEngine::instance()->currentTrackPlaylist()->id(); //tDebug() << Q_FUNC_INFO << "albumsView playlistInterface = " << ui->albumsView->playlistInterface()->id(); //tDebug() << Q_FUNC_INFO << "tracksView playlistInterface = " << ui->tracksView->playlistInterface()->id(); + + if ( ui->albumsView->isBeingPlayed() ) + return true; + if ( ui->albumsView->playlistInterface() == AudioEngine::instance()->currentTrackPlaylist() ) return true; @@ -94,6 +100,13 @@ AlbumInfoWidget::isBeingPlayed() const } +bool +AlbumInfoWidget::jumpToCurrentTrack() +{ + return ui->albumsView->jumpToCurrentTrack(); +} + + artist_ptr AlbumInfoWidget::descriptionArtist() const { if ( !m_album.isNull() && !m_album->artist().isNull() ) diff --git a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.h b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.h index 0c7c7248b..c4f756e51 100644 --- a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.h +++ b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.h @@ -41,6 +41,7 @@ class PlayableModel; class TreeModel; +class MetaAlbumInfoInterface; namespace Ui { @@ -70,7 +71,7 @@ public: virtual bool isTemporaryPage() const { return true; } virtual bool isBeingPlayed() const; - virtual bool jumpToCurrentTrack() { return false; } + virtual bool jumpToCurrentTrack(); public slots: /** \brief Loads information for a given album. @@ -104,10 +105,14 @@ private: PlayableModel* m_albumsModel; TreeModel* m_tracksModel; + Tomahawk::playlistinterface_ptr m_playlistInterface; + QString m_title; QString m_description; QString m_longDescription; QPixmap m_pixmap; + + friend class MetaAlbumInfoInterface; }; #endif // ALBUMINFOWIDGET_H diff --git a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget_p.h b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget_p.h new file mode 100644 index 000000000..b39fe65eb --- /dev/null +++ b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget_p.h @@ -0,0 +1,78 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2012, Leo Franchi + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#ifndef ALBUMINFOWIDGET_P_H +#define ALBUMINFOWIDGET_P_H + +#include "AlbumInfoWidget.h" +#include "ui_AlbumInfoWidget.h" +#include "PlaylistInterface.h" +#include "TreeProxyModel.h" +#include "Result.h" +#include "Typedefs.h" + +#include + +class MetaAlbumInfoInterface : public Tomahawk::PlaylistInterface +{ + Q_OBJECT +public: + explicit MetaAlbumInfoInterface( AlbumInfoWidget* w ) + : PlaylistInterface() + , m_w( w ) + { + connect( m_w->ui->tracksView->proxyModel()->playlistInterface().data(), SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ), + SIGNAL( repeatModeChanged( Tomahawk::PlaylistModes::RepeatMode ) ) ); + + connect( m_w->ui->tracksView->proxyModel()->playlistInterface().data(), SIGNAL( shuffleModeChanged( bool ) ), + SIGNAL( shuffleModeChanged( bool ) ) ); + } + virtual ~MetaAlbumInfoInterface() {} + + + virtual Tomahawk::PlaylistModes::RepeatMode repeatMode() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->repeatMode(); } + virtual bool shuffled() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->shuffled(); } + + virtual Tomahawk::result_ptr currentItem() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->currentItem(); } + virtual Tomahawk::result_ptr siblingItem( int itemsAway ) { return m_w->ui->tracksView->proxyModel()->playlistInterface()->siblingItem( itemsAway ); } + virtual int trackCount() const { return m_w->ui->tracksView->proxyModel()->playlistInterface()->trackCount(); } + virtual QList< Tomahawk::query_ptr > tracks() { return m_w->ui->tracksView->proxyModel()->playlistInterface()->tracks(); } + + virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr other ) + { + return m_w->ui->tracksView->proxyModel()->playlistInterface() == other || + m_w->ui->tracksView->proxyModel()->playlistInterface()->hasChildInterface( other ) || + m_w->ui->albumsView->playlistInterface()->hasChildInterface( other ); + } + + virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode mode ) + { + m_w->ui->tracksView->proxyModel()->playlistInterface()->setRepeatMode( mode ); + } + + virtual void setShuffled( bool enabled ) + { + m_w->ui->tracksView->proxyModel()->playlistInterface()->setShuffled( enabled ); + } + +private: + AlbumInfoWidget* m_w; + +}; + +#endif diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp index 9227dbe13..b533d16a6 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp @@ -57,7 +57,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* widget->setPalette( pal ); widget->setAutoFillBackground( true ); - m_plInterface = Tomahawk::playlistinterface_ptr( new MetaPlaylistInterface( this ) ); + m_plInterface = Tomahawk::playlistinterface_ptr( new MetaArtistInfoInterface( this ) ); /* TomahawkUtils::unmarginLayout( ui->layoutWidget->layout() ); TomahawkUtils::unmarginLayout( ui->layoutWidget1->layout() ); @@ -173,6 +173,12 @@ ArtistInfoWidget::playlistInterface() const bool ArtistInfoWidget::isBeingPlayed() const { + if ( ui->albums->isBeingPlayed() ) + return true; + + if ( ui->relatedArtists->isBeingPlayed() ) + return true; + if ( ui->albums->playlistInterface() == AudioEngine::instance()->currentTrackPlaylist() ) return true; @@ -198,6 +204,12 @@ ArtistInfoWidget::jumpToCurrentTrack() if ( ui->topHits->jumpToCurrentTrack() ) return true; + if ( ui->albums->jumpToCurrentTrack() ) + return true; + + if ( ui->relatedArtists->jumpToCurrentTrack() ) + return true; + return false; } diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h index c913ec859..a3b91f2a8 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h @@ -46,7 +46,7 @@ namespace Ui class ArtistInfoWidget; } -class MetaPlaylistInterface; +class MetaArtistInfoInterface; class DLLEXPORT ArtistInfoWidget : public QWidget, public Tomahawk::ViewPage { @@ -113,7 +113,7 @@ private: QString m_longDescription; QPixmap m_pixmap; - friend class MetaPlaylistInterface; + friend class ::MetaArtistInfoInterface; }; #endif // ARTISTINFOWIDGET_H diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget_p.h b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget_p.h index 10f6776b4..f923a5374 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget_p.h +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget_p.h @@ -29,11 +29,11 @@ #include -class MetaPlaylistInterface : public Tomahawk::PlaylistInterface +class MetaArtistInfoInterface : public Tomahawk::PlaylistInterface { Q_OBJECT public: - explicit MetaPlaylistInterface( ArtistInfoWidget* w ) + explicit MetaArtistInfoInterface( ArtistInfoWidget* w ) : PlaylistInterface() , m_w( w ) { @@ -51,7 +51,7 @@ public: connect( m_w->ui->topHits->proxyModel()->playlistInterface().data(), SIGNAL( shuffleModeChanged( bool ) ), SLOT( anyShuffleChanged( bool ) ) ); } - virtual ~MetaPlaylistInterface() {} + virtual ~MetaArtistInfoInterface() {} // Any one is fine, we keep them all synched @@ -70,7 +70,9 @@ public: { return ( m_w->ui->albums->playlistInterface() == other ) || ( m_w->ui->relatedArtists->playlistInterface() == other ) || - ( m_w->ui->topHits->playlistInterface() == other ); + ( m_w->ui->topHits->playlistInterface() == other ) || + ( m_w->ui->albums->playlistInterface()->hasChildInterface( other ) ) || + ( m_w->ui->relatedArtists->playlistInterface()->hasChildInterface( other ) ); } public slots: