From f6a8b812985ce1249b6ce52d6d9ebff894219416 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 10 Apr 2015 06:57:30 +0200 Subject: [PATCH] Rename Fancy style to SingleColumn and use it for ColumnView's model. --- src/libtomahawk/playlist/ColumnView.cpp | 2 +- src/libtomahawk/playlist/ContextView.cpp | 2 +- src/libtomahawk/playlist/InboxView.cpp | 2 +- src/libtomahawk/playlist/PlayableProxyModel.cpp | 16 ++++++++-------- src/libtomahawk/playlist/PlayableProxyModel.h | 2 +- .../playlist/PlaylistItemDelegate.cpp | 4 ++-- src/libtomahawk/playlist/QueueView.cpp | 2 +- src/libtomahawk/playlist/TrackView.cpp | 2 +- src/libtomahawk/viewpages/CollectionViewPage.cpp | 2 +- src/libtomahawk/viewpages/SourceViewPage.cpp | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/libtomahawk/playlist/ColumnView.cpp b/src/libtomahawk/playlist/ColumnView.cpp index 0fd3fa010..64235c2dd 100644 --- a/src/libtomahawk/playlist/ColumnView.cpp +++ b/src/libtomahawk/playlist/ColumnView.cpp @@ -135,7 +135,7 @@ ColumnView::setTreeModel( TreeModel* model ) guid(); // this will set the guid on the header - if ( m_proxyModel->style() == PlayableProxyModel::Fancy ) + if ( m_proxyModel->style() == PlayableProxyModel::SingleColumn ) { setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); } diff --git a/src/libtomahawk/playlist/ContextView.cpp b/src/libtomahawk/playlist/ContextView.cpp index 64f654b4a..148a1ca6e 100644 --- a/src/libtomahawk/playlist/ContextView.cpp +++ b/src/libtomahawk/playlist/ContextView.cpp @@ -47,7 +47,7 @@ ContextView::ContextView( QWidget* parent, const QString& caption ) { TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() ); m_trackView->setPlaylistItemDelegate( del ); - m_trackView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); + m_trackView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn ); m_trackView->setStyleSheet( QString( "QTreeView { background-color: %1; }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() ) ); TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() ); diff --git a/src/libtomahawk/playlist/InboxView.cpp b/src/libtomahawk/playlist/InboxView.cpp index d9b2bcfba..df2409646 100644 --- a/src/libtomahawk/playlist/InboxView.cpp +++ b/src/libtomahawk/playlist/InboxView.cpp @@ -32,7 +32,7 @@ InboxView::InboxView( QWidget* parent ) : TrackView( parent ) { - proxyModel()->setStyle( PlayableProxyModel::Fancy ); + proxyModel()->setStyle( PlayableProxyModel::SingleColumn ); TrackView::setGuid( "inbox" ); setHeaderHidden( true ); diff --git a/src/libtomahawk/playlist/PlayableProxyModel.cpp b/src/libtomahawk/playlist/PlayableProxyModel.cpp index 036aca842..4f0fa0c1c 100644 --- a/src/libtomahawk/playlist/PlayableProxyModel.cpp +++ b/src/libtomahawk/playlist/PlayableProxyModel.cpp @@ -48,10 +48,10 @@ PlayableProxyModel::PlayableProxyModel( QObject* parent ) PlayableProxyModel::setSourcePlayableModel( NULL ); - m_headerStyle[ Fancy ] << PlayableModel::Name; - m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score; - m_headerStyle[ Collection ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize; - m_headerStyle[ Locker ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::Download << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize; + m_headerStyle[ SingleColumn ] << PlayableModel::Name; + m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score; + m_headerStyle[ Collection ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize; + m_headerStyle[ Locker ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::Download << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize; } @@ -603,7 +603,7 @@ PlayableProxyModel::columnCount( const QModelIndex& parent ) const switch ( m_style ) { - case Fancy: + case SingleColumn: return 1; break; @@ -669,7 +669,7 @@ PlayableProxyModel::columnWeights() const switch ( m_style ) { - case Fancy: + case SingleColumn: w << 1.0; break; @@ -708,10 +708,10 @@ PlayableProxyModel::updateDetailedInfo( const QModelIndex& index ) { item->query()->track()->cover( QSize( 0, 0 ) ); - if ( style() == PlayableProxyModel::Fancy ) +/* if ( style() == PlayableProxyModel::Fancy ) { item->query()->track()->loadSocialActions(); - } + }*/ } } diff --git a/src/libtomahawk/playlist/PlayableProxyModel.h b/src/libtomahawk/playlist/PlayableProxyModel.h index 00c65e0c9..165f2988e 100644 --- a/src/libtomahawk/playlist/PlayableProxyModel.h +++ b/src/libtomahawk/playlist/PlayableProxyModel.h @@ -47,7 +47,7 @@ Q_OBJECT public: enum PlayableItemStyle - { Detailed = 0, Fancy = 1, Collection = 2, Locker = 3 }; + { Detailed = 0, SingleColumn = 1, Collection = 2, Locker = 3 }; enum PlayableProxyModelRole { StyleRole = Qt::UserRole + 1, TypeRole }; diff --git a/src/libtomahawk/playlist/PlaylistItemDelegate.cpp b/src/libtomahawk/playlist/PlaylistItemDelegate.cpp index ad5cafd8d..2eddf69c3 100644 --- a/src/libtomahawk/playlist/PlaylistItemDelegate.cpp +++ b/src/libtomahawk/playlist/PlaylistItemDelegate.cpp @@ -102,7 +102,7 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel QSize size = QStyledItemDelegate::sizeHint( option, index ); { - if ( m_model->style() != PlayableProxyModel::Fancy ) + if ( m_model->style() != PlayableProxyModel::SingleColumn ) { int rowHeight = option.fontMetrics.height() * 1.6; size.setHeight( rowHeight ); @@ -857,7 +857,7 @@ PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, con } else if ( hoveringInfo ) { - if ( m_model->style() == PlayableProxyModel::Fancy ) + if ( m_model->style() == PlayableProxyModel::SingleColumn ) { if ( item->query() ) ViewManager::instance()->show( item->query()->track()->toQuery() ); diff --git a/src/libtomahawk/playlist/QueueView.cpp b/src/libtomahawk/playlist/QueueView.cpp index 0c406542f..3bc469cb1 100644 --- a/src/libtomahawk/playlist/QueueView.cpp +++ b/src/libtomahawk/playlist/QueueView.cpp @@ -39,7 +39,7 @@ QueueView::QueueView( QWidget* parent ) view()->setCaption( tr( "Queue Details" ) ); view()->trackView()->setProxyModel( new QueueProxyModel( view()->trackView() ) ); - view()->trackView()->proxyModel()->setStyle( PlayableProxyModel::Fancy ); + view()->trackView()->proxyModel()->setStyle( PlayableProxyModel::SingleColumn ); view()->trackView()->setHeaderHidden( true ); view()->trackView()->setUniformRowHeights( false ); diff --git a/src/libtomahawk/playlist/TrackView.cpp b/src/libtomahawk/playlist/TrackView.cpp index 196bf7e79..f416cabc9 100644 --- a/src/libtomahawk/playlist/TrackView.cpp +++ b/src/libtomahawk/playlist/TrackView.cpp @@ -229,7 +229,7 @@ TrackView::setPlayableModel( PlayableModel* model ) switch( m_proxyModel->style() ) { - case PlayableProxyModel::Fancy: + case PlayableProxyModel::SingleColumn: setHeaderHidden( true ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); break; diff --git a/src/libtomahawk/viewpages/CollectionViewPage.cpp b/src/libtomahawk/viewpages/CollectionViewPage.cpp index 3718c94f0..3f366ebda 100644 --- a/src/libtomahawk/viewpages/CollectionViewPage.cpp +++ b/src/libtomahawk/viewpages/CollectionViewPage.cpp @@ -60,7 +60,7 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti m_header->setBackground( ImageRegistry::instance()->pixmap( RESPATH "images/collection_background.png", QSize( 0, 0 ) ), false ); setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultCollection, TomahawkUtils::Original, QSize( 256, 256 ) ) ); - m_columnView->proxyModel()->setStyle( PlayableProxyModel::Collection ); + m_columnView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn ); if ( collection->backendType() == Collection::ScriptCollectionType ) { diff --git a/src/libtomahawk/viewpages/SourceViewPage.cpp b/src/libtomahawk/viewpages/SourceViewPage.cpp index cc3528af7..c405ee304 100644 --- a/src/libtomahawk/viewpages/SourceViewPage.cpp +++ b/src/libtomahawk/viewpages/SourceViewPage.cpp @@ -50,13 +50,13 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget* ui->splitter->setStretchFactor( 1, 1 ); m_recentTracksModel = new RecentlyAddedModel( ui->recentCollectionView ); - ui->recentCollectionView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); + ui->recentCollectionView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn ); ui->recentCollectionView->setPlayableModel( m_recentTracksModel ); ui->recentCollectionView->sortByColumn( PlayableModel::Age, Qt::DescendingOrder ); m_recentTracksModel->setSource( source ); m_historyModel = new RecentlyPlayedModel( ui->historyView ); - ui->historyView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); + ui->historyView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn ); ui->historyView->setPlayableModel( m_historyModel ); m_historyModel->setSource( source );