From 2860bfc704d8509a3b35ba8e61c7abd83e53d766 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 31 May 2012 21:33:52 +0200 Subject: [PATCH] * ArtistView now uses LoadingSpinner and new OverlayWidget. --- src/libtomahawk/playlist/ArtistView.cpp | 9 ++++----- src/libtomahawk/playlist/ArtistView.h | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libtomahawk/playlist/ArtistView.cpp b/src/libtomahawk/playlist/ArtistView.cpp index e080847f0..73387be7b 100644 --- a/src/libtomahawk/playlist/ArtistView.cpp +++ b/src/libtomahawk/playlist/ArtistView.cpp @@ -51,8 +51,7 @@ ArtistView::ArtistView( QWidget* parent ) , m_overlay( new OverlayWidget( this ) ) , m_model( 0 ) , m_proxyModel( 0 ) -// , m_delegate( 0 ) - , m_loadingSpinner( new AnimatedSpinner( this ) ) + , m_loadingSpinner( new LoadingSpinner( this ) ) , m_updateContextView( true ) , m_contextMenu( new ContextMenu( this ) ) , m_showModes( true ) @@ -137,8 +136,6 @@ ArtistView::setTreeModel( TreeModel* model ) m_proxyModel->sort( 0 ); } - connect( m_model, SIGNAL( loadingStarted() ), m_loadingSpinner, SLOT( fadeIn() ) ); - connect( m_model, SIGNAL( loadingFinished() ), m_loadingSpinner, SLOT( fadeOut() ) ); connect( m_proxyModel, SIGNAL( filteringStarted() ), SLOT( onFilteringStarted() ) ); connect( m_proxyModel, SIGNAL( filteringFinished() ), m_loadingSpinner, SLOT( fadeOut() ) ); @@ -148,7 +145,7 @@ ArtistView::setTreeModel( TreeModel* model ) guid(); // this will set the guid on the header - if ( model->columnStyle() == TreeModel::TrackOnly ) + if ( model->style() == PlayableModel::Large ) { setHeaderHidden( true ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); @@ -158,6 +155,8 @@ ArtistView::setTreeModel( TreeModel* model ) setHeaderHidden( false ); setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded ); } + + emit modelChanged(); } diff --git a/src/libtomahawk/playlist/ArtistView.h b/src/libtomahawk/playlist/ArtistView.h index 90c76e66f..f113c78c3 100644 --- a/src/libtomahawk/playlist/ArtistView.h +++ b/src/libtomahawk/playlist/ArtistView.h @@ -83,6 +83,9 @@ public: public slots: void onItemActivated( const QModelIndex& index ); +signals: + void modelChanged(); + protected: virtual void startDrag( Qt::DropActions supportedActions ); virtual void resizeEvent( QResizeEvent* event ); @@ -107,7 +110,6 @@ private: OverlayWidget* m_overlay; TreeModel* m_model; TreeProxyModel* m_proxyModel; -// PlaylistItemDelegate* m_delegate; AnimatedSpinner* m_loadingSpinner; bool m_updateContextView;