diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 18fa35ed0..bfe932f53 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -62,6 +62,7 @@ set( libGuiSources playlist/GridItemDelegate.cpp playlist/GridView.cpp playlist/TreeView.cpp + playlist/TreeWidget.cpp playlist/ViewHeader.cpp playlist/LovedTracksModel.cpp playlist/RecentlyAddedModel.cpp @@ -117,6 +118,7 @@ set( libGuiSources widgets/AnimatedCounterLabel.cpp widgets/BasicHeader.cpp + widgets/FilterHeader.cpp widgets/Breadcrumb.cpp widgets/BreadcrumbButton.cpp widgets/CheckDirTree.cpp diff --git a/src/libtomahawk/ViewManager.cpp b/src/libtomahawk/ViewManager.cpp index e1a9e2b18..148e74f6a 100644 --- a/src/libtomahawk/ViewManager.cpp +++ b/src/libtomahawk/ViewManager.cpp @@ -31,6 +31,7 @@ #include "playlist/PlayableProxyModel.h" #include "playlist/PlayableModel.h" #include "playlist/TreeView.h" +#include "playlist/TreeWidget.h" #include "playlist/GridView.h" #include "playlist/AlbumModel.h" #include "SourceList.h" @@ -92,10 +93,10 @@ ViewManager::ViewManager( QObject* parent ) m_widget->layout()->addWidget( m_stack ); m_widget->layout()->addWidget( m_contextWidget ); - m_superCollectionView = new TreeView(); - m_superCollectionView->proxyModel()->setStyle( PlayableProxyModel::Collection ); + m_superCollectionView = new TreeWidget(); + m_superCollectionView->view()->proxyModel()->setStyle( PlayableProxyModel::Collection ); m_superCollectionModel = new TreeModel( m_superCollectionView ); - m_superCollectionView->setTreeModel( m_superCollectionModel ); + m_superCollectionView->view()->setTreeModel( m_superCollectionModel ); // m_superCollectionView->proxyModel()->setShowOfflineResults( false ); m_stack->setContentsMargins( 0, 0, 0, 0 ); @@ -270,28 +271,28 @@ ViewManager::show( const Tomahawk::collection_ptr& collection ) { m_currentCollection = collection; - TreeView* view; - if ( !m_treeViews.contains( collection ) || m_treeViews.value( collection ).isNull() ) + TreeWidget* widget; + if ( !m_treeWidgets.contains( collection ) || m_treeWidgets.value( collection ).isNull() ) { - view = new TreeView(); - view->proxyModel()->setStyle( PlayableProxyModel::Collection ); + widget = new TreeWidget(); + widget->view()->proxyModel()->setStyle( PlayableProxyModel::Collection ); TreeModel* model = new TreeModel(); - view->setTreeModel( model ); + widget->view()->setTreeModel( model ); if ( !collection.isNull() ) - view->setEmptyTip( collection->emptyText() ); + widget->view()->setEmptyTip( collection->emptyText() ); model->addCollection( collection ); - m_treeViews.insert( collection, view ); + m_treeWidgets.insert( collection, widget ); } else { - view = m_treeViews.value( collection ).data(); + widget = m_treeWidgets.value( collection ).data(); } - setPage( view ); - return view; + setPage( widget ); + return widget; } @@ -800,7 +801,7 @@ ViewManager::recentPlaysWidget() const } -TreeView* +Tomahawk::ViewPage* ViewManager::superCollectionView() const { return m_superCollectionView; diff --git a/src/libtomahawk/ViewManager.h b/src/libtomahawk/ViewManager.h index 0f95c567e..7d0346700 100644 --- a/src/libtomahawk/ViewManager.h +++ b/src/libtomahawk/ViewManager.h @@ -37,7 +37,7 @@ class AlbumModel; class GridView; class AlbumInfoWidget; class ArtistInfoWidget; -class TreeView; +class TreeWidget; class CollectionModel; class ContextWidget; class FlexibleView; @@ -91,7 +91,7 @@ public: Tomahawk::ViewPage* whatsHotWidget() const; Tomahawk::ViewPage* newReleasesWidget() const; Tomahawk::ViewPage* recentPlaysWidget() const; - TreeView* superCollectionView() const; + Tomahawk::ViewPage* superCollectionView() const; /// Get the view page for the given item. Not pretty... Tomahawk::ViewPage* pageForPlaylist( const Tomahawk::playlist_ptr& pl ) const; @@ -175,7 +175,7 @@ private: AnimatedSplitter* m_splitter; TreeModel* m_superCollectionModel; - TreeView* m_superCollectionView; + TreeWidget* m_superCollectionView; QueueView* m_queue; WelcomeWidget* m_welcomeWidget; WhatsHotWidget* m_whatsHotWidget; @@ -185,7 +185,7 @@ private: QList< Tomahawk::collection_ptr > m_superCollections; QHash< Tomahawk::dynplaylist_ptr, QPointer > m_dynamicWidgets; - QHash< Tomahawk::collection_ptr, QPointer > m_treeViews; + QHash< Tomahawk::collection_ptr, QPointer > m_treeWidgets; QHash< Tomahawk::artist_ptr, QPointer > m_artistViews; QHash< Tomahawk::album_ptr, QPointer > m_albumViews; QHash< Tomahawk::query_ptr, QPointer > m_trackViews; diff --git a/src/libtomahawk/playlist/FlexibleHeader.cpp b/src/libtomahawk/playlist/FlexibleHeader.cpp index f03ea1399..a539e071c 100644 --- a/src/libtomahawk/playlist/FlexibleHeader.cpp +++ b/src/libtomahawk/playlist/FlexibleHeader.cpp @@ -1,7 +1,7 @@ /* === This file is part of Tomahawk Player - === * * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2012, Teo Mrnjavac + * Copyright 2012-2013, Teo Mrnjavac * * Tomahawk is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,6 @@ #include "playlist/FlexibleView.h" #include "ViewManager.h" -#include "thirdparty/Qocoa/qsearchfield.h" #include "utils/Closure.h" #include "utils/TomahawkUtilsGui.h" #include "utils/Logger.h" @@ -41,7 +40,7 @@ using namespace Tomahawk; FlexibleHeader::FlexibleHeader( FlexibleView* parent ) - : BasicHeader( parent ) + : FilterHeader( parent ) , m_parent( parent ) { QFile f( RESPATH "stylesheets/topbar-radiobuttons.css" ); @@ -81,17 +80,9 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent ) outerModeLayout->addWidget( modeWidget ); outerModeLayout->addStretch(); - m_filterField = new QSearchField( this ); - m_filterField->setPlaceholderText( tr( "Filter..." ) ); - m_filterField->setFixedWidth( 220 ); - m_mainLayout->addWidget( m_filterField ); - TomahawkUtils::unmarginLayout( outerModeLayout ); TomahawkUtils::unmarginLayout( modeLayout ); - connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) ); - connect( m_filterField, SIGNAL( textChanged( QString ) ), SLOT( onFilterEdited() ) ); - NewClosure( m_radioNormal, SIGNAL( clicked() ), const_cast< FlexibleView* >( parent ), SLOT( setCurrentMode( FlexibleViewMode ) ), FlexibleView::Flat )->setAutoDelete( false ); NewClosure( m_radioDetailed, SIGNAL( clicked() ), const_cast< FlexibleView* >( parent ), SLOT( setCurrentMode( FlexibleViewMode ) ), FlexibleView::Detailed )->setAutoDelete( false ); NewClosure( m_radioCloud, SIGNAL( clicked() ), const_cast< FlexibleView* >( parent ), SLOT( setCurrentMode( FlexibleViewMode ) ), FlexibleView::Grid )->setAutoDelete( false ); @@ -103,32 +94,6 @@ FlexibleHeader::~FlexibleHeader() } -void -FlexibleHeader::setFilter( const QString& filter ) -{ - m_filterField->setText( filter ); -} - - -void -FlexibleHeader::onFilterEdited() -{ - m_filter = m_filterField->text(); - - m_filterTimer.stop(); - m_filterTimer.setInterval( 280 ); - m_filterTimer.setSingleShot( true ); - m_filterTimer.start(); -} - - -void -FlexibleHeader::applyFilter() -{ - emit filterTextChanged( m_filterField->text() ); -} - - void FlexibleHeader::changeEvent( QEvent* e ) { diff --git a/src/libtomahawk/playlist/FlexibleHeader.h b/src/libtomahawk/playlist/FlexibleHeader.h index c55de483d..a206cac6d 100644 --- a/src/libtomahawk/playlist/FlexibleHeader.h +++ b/src/libtomahawk/playlist/FlexibleHeader.h @@ -1,7 +1,7 @@ /* === This file is part of Tomahawk Player - === * * Copyright 2010-2011, Christian Muehlhaeuser - * Copyright 2012, Teo Mrnjavac + * Copyright 2012-2013, Teo Mrnjavac * * Tomahawk is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,18 +20,14 @@ #ifndef FLEXIBLEHEADER_H #define FLEXIBLEHEADER_H -#include - -#include "widgets/BasicHeader.h" -#include "DllMacro.h" +#include "widgets/FilterHeader.h" #include "Artist.h" class QPaintEvent; class FlexibleView; class QRadioButton; -class QSearchField; -class DLLEXPORT FlexibleHeader : public BasicHeader +class DLLEXPORT FlexibleHeader : public FilterHeader { Q_OBJECT @@ -39,30 +35,16 @@ public: FlexibleHeader( FlexibleView* parent ); ~FlexibleHeader(); -public slots: - void setFilter( const QString& filter ); - -signals: - void filterTextChanged( const QString& filter ); - protected: void changeEvent( QEvent* e ); -private slots: - void onFilterEdited(); - void applyFilter(); - private: FlexibleView* m_parent; - QString m_filter; - QTimer m_filterTimer; - QRadioButton* m_radioCloud; QRadioButton* m_radioDetailed; QRadioButton* m_radioNormal; - QSearchField* m_filterField; }; #endif diff --git a/src/libtomahawk/playlist/TreeProxyModel.cpp b/src/libtomahawk/playlist/TreeProxyModel.cpp index d620faaa5..45af5eda0 100644 --- a/src/libtomahawk/playlist/TreeProxyModel.cpp +++ b/src/libtomahawk/playlist/TreeProxyModel.cpp @@ -125,6 +125,13 @@ TreeProxyModel::setFilter( const QString& pattern ) } +QString +TreeProxyModel::filter() const +{ + return m_filter; +} + + void TreeProxyModel::onFilterArtists( const QList& artists ) { diff --git a/src/libtomahawk/playlist/TreeProxyModel.h b/src/libtomahawk/playlist/TreeProxyModel.h index be68f50d6..9d0e21839 100644 --- a/src/libtomahawk/playlist/TreeProxyModel.h +++ b/src/libtomahawk/playlist/TreeProxyModel.h @@ -46,6 +46,7 @@ public: virtual void setSourcePlayableModel( PlayableModel* ) { Q_ASSERT( false ); } virtual void setFilter( const QString& pattern ); + virtual QString filter() const; QModelIndex indexFromArtist( const Tomahawk::artist_ptr& artist ) const; QModelIndex indexFromAlbum( const Tomahawk::album_ptr& album ) const; diff --git a/src/libtomahawk/playlist/TreeView.cpp b/src/libtomahawk/playlist/TreeView.cpp index 9b314a6a1..ffb5e6b9b 100644 --- a/src/libtomahawk/playlist/TreeView.cpp +++ b/src/libtomahawk/playlist/TreeView.cpp @@ -147,6 +147,7 @@ TreeView::setTreeModel( TreeModel* model ) setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded ); } + connect( model, SIGNAL( changed() ), this, SIGNAL( modelChanged() ) ); emit modelChanged(); /* setColumnHidden( PlayableModel::Score, true ); // Hide score column per default @@ -290,9 +291,9 @@ TreeView::onFilterChangeFinished() if ( selectedIndexes().count() ) scrollTo( selectedIndexes().at( 0 ), QAbstractItemView::PositionAtCenter ); - if ( !filter().isEmpty() && !proxyModel()->playlistInterface()->trackCount() && model()->trackCount() ) + if ( !proxyModel()->filter().isEmpty() && !proxyModel()->playlistInterface()->trackCount() && model()->trackCount() ) { - m_overlay->setText( tr( "Sorry, your filter '%1' did not match any results." ).arg( filter() ) ); + m_overlay->setText( tr( "Sorry, your filter '%1' did not match any results." ).arg( proxyModel()->filter() ) ); m_overlay->show(); } else @@ -394,7 +395,7 @@ TreeView::onCustomContextMenu( const QPoint& pos ) m_contextMenu->setQueries( queries ); m_contextMenu->setArtists( artists ); m_contextMenu->setAlbums( albums ); - m_contextMenu->setPlaylistInterface( playlistInterface() ); + m_contextMenu->setPlaylistInterface( proxyModel()->playlistInterface() ); m_contextMenu->exec( viewport()->mapToGlobal( pos ) ); } @@ -527,12 +528,3 @@ TreeView::guid() const return m_guid; } - - -bool -TreeView::setFilter( const QString& filter ) -{ - ViewPage::setFilter( filter ); - m_proxyModel->setFilter( filter ); - return true; -} diff --git a/src/libtomahawk/playlist/TreeView.h b/src/libtomahawk/playlist/TreeView.h index 288d6dab1..217579bb2 100644 --- a/src/libtomahawk/playlist/TreeView.h +++ b/src/libtomahawk/playlist/TreeView.h @@ -41,7 +41,7 @@ class AnimatedSpinner; class OverlayWidget; class TreeModel; -class DLLEXPORT TreeView : public QTreeView, public Tomahawk::ViewPage +class DLLEXPORT TreeView : public QTreeView { Q_OBJECT @@ -63,15 +63,6 @@ public: void setEmptyTip( const QString& tip ); - virtual QWidget* widget() { return this; } - virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->playlistInterface(); } - - virtual QString title() const { return m_model->title(); } - virtual QString description() const { return m_model->description(); } - virtual QPixmap pixmap() const { return m_model->icon(); } - - virtual bool showFilter() const { return true; } - virtual bool setFilter( const QString& filter ); virtual bool jumpToCurrentTrack(); QModelIndex hoveredIndex() const { return m_hoveredIndex; } diff --git a/src/libtomahawk/playlist/TreeWidget.cpp b/src/libtomahawk/playlist/TreeWidget.cpp new file mode 100644 index 000000000..6ed21b2fd --- /dev/null +++ b/src/libtomahawk/playlist/TreeWidget.cpp @@ -0,0 +1,125 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2013, Teo Mrnjavac + * + * 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 . + */ + +#include "TreeWidget.h" + +#include "utils/TomahawkUtilsGui.h" + +#include + +TreeWidget::TreeWidget( QWidget* parent ) + : QWidget( parent ) + , m_view( new TreeView( this ) ) + , m_header( new FilterHeader( this ) ) +{ + QVBoxLayout* mainLayout = new QVBoxLayout; + mainLayout->addWidget( m_header ); + mainLayout->addWidget( m_view ); + setLayout( mainLayout ); + TomahawkUtils::unmarginLayout( mainLayout ); + + connect( m_header, SIGNAL( filterTextChanged( QString ) ), + this, SLOT( setFilter( QString ) ) ); + connect( m_view, SIGNAL( modelChanged() ), + this, SLOT( onModelChanged() ) ); +} + + +TreeWidget::~TreeWidget() +{} + + +TreeView* +TreeWidget::view() const +{ + return m_view; +} + + +QWidget* +TreeWidget::widget() +{ + return this; +} + + +Tomahawk::playlistinterface_ptr +TreeWidget::playlistInterface() const +{ + return m_view->proxyModel()->playlistInterface(); +} + + +QString +TreeWidget::title() const +{ + return m_view->model()->title(); +} + + +QString +TreeWidget::description() const +{ + return m_view->model()->description(); +} + + +QPixmap +TreeWidget::pixmap() const +{ + return m_view->model()->icon(); +} + + +bool +TreeWidget::showFilter() const +{ + return true; +} + + +bool +TreeWidget::setFilter( const QString& filter ) +{ + ViewPage::setFilter( filter ); + m_view->proxyModel()->setFilter( filter ); + return true; +} + + +void +TreeWidget::onModelChanged() +{ + m_header->setCaption( m_view->model()->title() ); + m_header->setDescription( m_view->model()->description() ); + m_header->setPixmap( m_view->model()->icon() ); +} + + +bool +TreeWidget::jumpToCurrentTrack() +{ + return m_view->jumpToCurrentTrack(); +} + + +bool +TreeWidget::showInfoBar() const +{ + return false; +} diff --git a/src/libtomahawk/playlist/TreeWidget.h b/src/libtomahawk/playlist/TreeWidget.h new file mode 100644 index 000000000..229282a0e --- /dev/null +++ b/src/libtomahawk/playlist/TreeWidget.h @@ -0,0 +1,60 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2013, Teo Mrnjavac + * + * 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 TREEWIDGET_H +#define TREEWIDGET_H + +#include "TreeView.h" +#include "ViewPage.h" +#include "widgets/FilterHeader.h" + +#include + +class DLLEXPORT TreeWidget : public QWidget, public Tomahawk::ViewPage +{ + Q_OBJECT +public: + explicit TreeWidget( QWidget* parent = 0 ); + virtual ~TreeWidget(); + + TreeView* view() const; + + virtual QWidget* widget(); + virtual Tomahawk::playlistinterface_ptr playlistInterface() const; + + virtual QString title() const; + virtual QString description() const; + virtual QPixmap pixmap() const; + + virtual bool showFilter() const; + virtual bool jumpToCurrentTrack(); + + virtual bool showInfoBar() const; + +public slots: + virtual bool setFilter( const QString& filter ); + +private slots: + void onModelChanged(); + +private: + TreeView* m_view; + BasicHeader* m_header; +}; + +#endif // TREEWIDGET_H diff --git a/src/libtomahawk/widgets/BasicHeader.cpp b/src/libtomahawk/widgets/BasicHeader.cpp index 2ac67f406..0d9bca8da 100644 --- a/src/libtomahawk/widgets/BasicHeader.cpp +++ b/src/libtomahawk/widgets/BasicHeader.cpp @@ -31,8 +31,6 @@ using namespace Tomahawk; -QPixmap* BasicHeader::s_tiledHeader = 0; - BasicHeader::BasicHeader( QWidget* parent ) : QWidget( parent ) @@ -55,6 +53,7 @@ BasicHeader::BasicHeader( QWidget* parent ) m_verticalLayout->addStretch(); m_mainLayout->addSpacing( 16 ); + m_mainLayout->setStretchFactor( m_verticalLayout, 2 ); QPalette pal = palette(); pal.setColor( QPalette::Foreground, Qt::white ); diff --git a/src/libtomahawk/widgets/BasicHeader.h b/src/libtomahawk/widgets/BasicHeader.h index 48f3281ff..7fc990bd6 100644 --- a/src/libtomahawk/widgets/BasicHeader.h +++ b/src/libtomahawk/widgets/BasicHeader.h @@ -50,8 +50,6 @@ protected: QBoxLayout* m_mainLayout; QBoxLayout* m_verticalLayout; - - static QPixmap* s_tiledHeader; }; #endif // BASICHEADER_H diff --git a/src/libtomahawk/widgets/FilterHeader.cpp b/src/libtomahawk/widgets/FilterHeader.cpp new file mode 100644 index 000000000..823d4d954 --- /dev/null +++ b/src/libtomahawk/widgets/FilterHeader.cpp @@ -0,0 +1,66 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2013, Teo Mrnjavac + * + * 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 . + */ + +#include "FilterHeader.h" + +#include "thirdparty/Qocoa/qsearchfield.h" + +#include + +FilterHeader::FilterHeader( QWidget* parent ) + : BasicHeader( parent ) +{ + m_filterField = new QSearchField( this ); + m_filterField->setPlaceholderText( tr( "Filter..." ) ); + m_filterField->setFixedWidth( 220 ); + m_mainLayout->addWidget( m_filterField ); + + connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) ); + connect( m_filterField, SIGNAL( textChanged( QString ) ), SLOT( onFilterEdited() ) ); +} + + +FilterHeader::~FilterHeader() +{ +} + + +void +FilterHeader::setFilter( const QString& filter ) +{ + m_filterField->setText( filter ); +} + + +void +FilterHeader::onFilterEdited() +{ + m_filter = m_filterField->text(); + + m_filterTimer.stop(); + m_filterTimer.setInterval( 280 ); + m_filterTimer.setSingleShot( true ); + m_filterTimer.start(); +} + + +void +FilterHeader::applyFilter() +{ + emit filterTextChanged( m_filterField->text() ); +} diff --git a/src/libtomahawk/widgets/FilterHeader.h b/src/libtomahawk/widgets/FilterHeader.h new file mode 100644 index 000000000..7ede2746b --- /dev/null +++ b/src/libtomahawk/widgets/FilterHeader.h @@ -0,0 +1,54 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2013, Teo Mrnjavac + * + * 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 FILTERHEADER_H +#define FILTERHEADER_H + +#include "widgets/BasicHeader.h" + +#include "DllMacro.h" + +#include + +class QSearchField; + +class DLLEXPORT FilterHeader : public BasicHeader +{ + Q_OBJECT +public: + explicit FilterHeader( QWidget *parent = 0 ); + virtual ~FilterHeader(); + +public slots: + void setFilter( const QString& filter ); + +signals: + void filterTextChanged( const QString& filter ); + +private slots: + void onFilterEdited(); + void applyFilter(); + +private: + QString m_filter; + QTimer m_filterTimer; + + QSearchField* m_filterField; +}; + +#endif // FILTERHEADER_H diff --git a/src/libtomahawk/widgets/WhatsHotWidget.cpp b/src/libtomahawk/widgets/WhatsHotWidget.cpp index ff66a5c18..de1318423 100644 --- a/src/libtomahawk/widgets/WhatsHotWidget.cpp +++ b/src/libtomahawk/widgets/WhatsHotWidget.cpp @@ -107,7 +107,7 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent ) MetaPlaylistInterface* mpl = new MetaPlaylistInterface(); mpl->addChildInterface( ui->tracksViewLeft->playlistInterface() ); - mpl->addChildInterface( ui->artistsViewLeft->playlistInterface() ); + mpl->addChildInterface( ui->artistsViewLeft->proxyModel()->playlistInterface() ); mpl->addChildInterface( ui->albumsView->playlistInterface() ); m_playlistInterface = playlistinterface_ptr( mpl ); } @@ -138,7 +138,7 @@ WhatsHotWidget::playlistInterface() const bool WhatsHotWidget::isBeingPlayed() const { - if ( AudioEngine::instance()->currentTrackPlaylist() == ui->artistsViewLeft->playlistInterface() ) + if ( AudioEngine::instance()->currentTrackPlaylist() == ui->artistsViewLeft->proxyModel()->playlistInterface() ) return true; if ( AudioEngine::instance()->currentTrackPlaylist() == ui->tracksViewLeft->playlistInterface() )