diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index fa7b7607a..1bd3e92c8 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -62,7 +62,7 @@ set( libGuiSources playlist/TrackHeader.cpp playlist/AlbumModel.cpp playlist/AlbumItemDelegate.cpp - playlist/AlbumView.cpp + playlist/GridView.cpp playlist/ArtistView.cpp playlist/CustomPlaylistView.cpp playlist/ViewHeader.cpp diff --git a/src/libtomahawk/ViewManager.cpp b/src/libtomahawk/ViewManager.cpp index a66bc63df..d2543b6ac 100644 --- a/src/libtomahawk/ViewManager.cpp +++ b/src/libtomahawk/ViewManager.cpp @@ -33,7 +33,7 @@ #include "PlayableProxyModel.h" #include "PlayableModel.h" #include "ArtistView.h" -#include "AlbumView.h" +#include "GridView.h" #include "AlbumModel.h" #include "SourceList.h" #include "TomahawkSettings.h" @@ -99,9 +99,9 @@ ViewManager::ViewManager( QObject* parent ) m_superCollectionView->setShowModes( false ); // m_superCollectionView->proxyModel()->setShowOfflineResults( false ); - m_superAlbumView = new AlbumView(); - m_superAlbumModel = new AlbumModel( m_superAlbumView ); - m_superAlbumView->setPlayableModel( m_superAlbumModel ); + m_superGridView = new GridView(); + m_superAlbumModel = new AlbumModel( m_superGridView ); + m_superGridView->setPlayableModel( m_superAlbumModel ); m_stack->setContentsMargins( 0, 0, 0, 0 ); m_widget->setContentsMargins( 0, 0, 0, 0 ); @@ -321,19 +321,19 @@ ViewManager::show( const Tomahawk::collection_ptr& collection ) if ( m_currentMode == PlaylistModes::Album ) { - AlbumView* aview; - if ( !m_collectionAlbumViews.contains( collection ) || m_collectionAlbumViews.value( collection ).isNull() ) + GridView* aview; + if ( !m_collectionGridViews.contains( collection ) || m_collectionGridViews.value( collection ).isNull() ) { - aview = new AlbumView(); + aview = new GridView(); AlbumModel* amodel = new AlbumModel( aview ); aview->setPlayableModel( amodel ); amodel->addCollection( collection ); - m_collectionAlbumViews.insert( collection, aview ); + m_collectionGridViews.insert( collection, aview ); } else { - aview = m_collectionAlbumViews.value( collection ).data(); + aview = m_collectionGridViews.value( collection ).data(); } shown = aview; @@ -406,8 +406,8 @@ ViewManager::showSuperCollection() } else if ( m_currentMode == PlaylistModes::Album ) { - shown = m_superAlbumView; - setPage( m_superAlbumView ); + shown = m_superGridView; + setPage( m_superGridView ); } emit numSourcesChanged( m_superCollections.count() ); @@ -993,11 +993,11 @@ ViewManager::dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interf Tomahawk::collection_ptr ViewManager::collectionForInterface( Tomahawk::playlistinterface_ptr interface ) const { - foreach ( QWeakPointer view, m_collectionAlbumViews.values() ) + foreach ( QWeakPointer view, m_collectionGridViews.values() ) { if ( view.data()->playlistInterface() == interface ) { - return m_collectionAlbumViews.key( view ); + return m_collectionGridViews.key( view ); } } @@ -1010,7 +1010,7 @@ ViewManager::isSuperCollectionVisible() const { return ( currentPage() != 0 && ( currentPage()->playlistInterface() == m_superCollectionView->playlistInterface() || - currentPage()->playlistInterface() == m_superAlbumView->playlistInterface() ) ); + currentPage()->playlistInterface() == m_superGridView->playlistInterface() ) ); } @@ -1028,7 +1028,7 @@ ViewManager::showCurrentTrack() if ( dynamic_cast< TrackView* >( page ) ) m_currentMode = PlaylistModes::Flat; - else if ( dynamic_cast< AlbumView* >( page ) ) + else if ( dynamic_cast< GridView* >( page ) ) m_currentMode = PlaylistModes::Album; else if ( dynamic_cast< ArtistView* >( page ) ) m_currentMode = PlaylistModes::Tree; diff --git a/src/libtomahawk/ViewManager.h b/src/libtomahawk/ViewManager.h index c25234900..50ab8ae85 100644 --- a/src/libtomahawk/ViewManager.h +++ b/src/libtomahawk/ViewManager.h @@ -34,7 +34,7 @@ class AnimatedSplitter; class AlbumModel; -class AlbumView; +class GridView; class AlbumInfoWidget; class ArtistInfoWidget; class ArtistView; @@ -202,7 +202,7 @@ private: AnimatedSplitter* m_splitter; AlbumModel* m_superAlbumModel; - AlbumView* m_superAlbumView; + GridView* m_superGridView; TreeModel* m_superCollectionModel; ArtistView* m_superCollectionView; QueueView* m_queue; @@ -216,7 +216,7 @@ private: QHash< Tomahawk::dynplaylist_ptr, QWeakPointer > m_dynamicWidgets; QHash< Tomahawk::collection_ptr, QWeakPointer > m_treeViews; - QHash< Tomahawk::collection_ptr, QWeakPointer > m_collectionAlbumViews; + QHash< Tomahawk::collection_ptr, QWeakPointer > m_collectionGridViews; QHash< Tomahawk::artist_ptr, QWeakPointer > m_artistViews; QHash< Tomahawk::album_ptr, QWeakPointer > m_albumViews; QHash< Tomahawk::query_ptr, QWeakPointer > m_trackViews; diff --git a/src/libtomahawk/playlist/AlbumItemDelegate.cpp b/src/libtomahawk/playlist/AlbumItemDelegate.cpp index 949b439fb..b160a1dee 100644 --- a/src/libtomahawk/playlist/AlbumItemDelegate.cpp +++ b/src/libtomahawk/playlist/AlbumItemDelegate.cpp @@ -37,7 +37,7 @@ #include "playlist/PlayableItem.h" #include "playlist/PlayableProxyModel.h" -#include "AlbumView.h" +#include "GridView.h" #include "ViewManager.h" #include "utils/AnimatedSpinner.h" #include "widgets/ImageButton.h" @@ -406,7 +406,7 @@ AlbumItemDelegate::modelChanged() widget->deleteLater(); m_spinner.clear(); - if ( AlbumView* view = qobject_cast< AlbumView* >( m_view ) ) + if ( GridView* view = qobject_cast< GridView* >( m_view ) ) m_model = view->proxyModel(); } diff --git a/src/libtomahawk/playlist/GridView.cpp b/src/libtomahawk/playlist/GridView.cpp index 963812375..4b196e1c9 100644 --- a/src/libtomahawk/playlist/GridView.cpp +++ b/src/libtomahawk/playlist/GridView.cpp @@ -17,7 +17,7 @@ * along with Tomahawk. If not, see . */ -#include "AlbumView.h" +#include "GridView.h" #include #include @@ -45,7 +45,7 @@ using namespace Tomahawk; -AlbumView::AlbumView( QWidget* parent ) +GridView::GridView( QWidget* parent ) : QListView( parent ) , m_model( 0 ) , m_proxyModel( 0 ) @@ -88,14 +88,14 @@ AlbumView::AlbumView( QWidget* parent ) } -AlbumView::~AlbumView() +GridView::~GridView() { qDebug() << Q_FUNC_INFO; } void -AlbumView::setProxyModel( PlayableProxyModel* model ) +GridView::setProxyModel( PlayableProxyModel* model ) { m_proxyModel = model; m_delegate = new AlbumItemDelegate( this, m_proxyModel ); @@ -107,7 +107,7 @@ AlbumView::setProxyModel( PlayableProxyModel* model ) void -AlbumView::setModel( QAbstractItemModel* model ) +GridView::setModel( QAbstractItemModel* model ) { Q_UNUSED( model ); qDebug() << "Explicitly use setAlbumModel instead"; @@ -116,7 +116,7 @@ AlbumView::setModel( QAbstractItemModel* model ) void -AlbumView::setPlayableModel( PlayableModel* model ) +GridView::setPlayableModel( PlayableModel* model ) { m_inited = false; m_model = model; @@ -134,7 +134,7 @@ AlbumView::setPlayableModel( PlayableModel* model ) void -AlbumView::currentChanged( const QModelIndex& current, const QModelIndex& previous ) +GridView::currentChanged( const QModelIndex& current, const QModelIndex& previous ) { QListView::currentChanged( current, previous ); @@ -148,7 +148,7 @@ AlbumView::currentChanged( const QModelIndex& current, const QModelIndex& previo void -AlbumView::onItemActivated( const QModelIndex& index ) +GridView::onItemActivated( const QModelIndex& index ) { PlayableItem* item = m_model->itemFromIndex( m_proxyModel->mapToSource( index ) ); if ( item ) @@ -167,7 +167,7 @@ AlbumView::onItemActivated( const QModelIndex& index ) void -AlbumView::scrollContentsBy( int dx, int dy ) +GridView::scrollContentsBy( int dx, int dy ) { QListView::scrollContentsBy( dx, dy ); emit scrolledContents( dx, dy ); @@ -175,7 +175,7 @@ AlbumView::scrollContentsBy( int dx, int dy ) void -AlbumView::paintEvent( QPaintEvent* event ) +GridView::paintEvent( QPaintEvent* event ) { if ( !autoFitItems() || m_inited || !m_proxyModel->rowCount() ) QListView::paintEvent( event ); @@ -183,7 +183,7 @@ AlbumView::paintEvent( QPaintEvent* event ) void -AlbumView::resizeEvent( QResizeEvent* event ) +GridView::resizeEvent( QResizeEvent* event ) { QListView::resizeEvent( event ); layoutItems(); @@ -191,7 +191,7 @@ AlbumView::resizeEvent( QResizeEvent* event ) void -AlbumView::layoutItems() +GridView::layoutItems() { if ( autoFitItems() && m_model ) { @@ -225,7 +225,7 @@ AlbumView::layoutItems() void -AlbumView::onFilterChanged( const QString& ) +GridView::onFilterChanged( const QString& ) { if ( selectedIndexes().count() ) scrollTo( selectedIndexes().at( 0 ), QAbstractItemView::PositionAtCenter ); @@ -233,7 +233,7 @@ AlbumView::onFilterChanged( const QString& ) void -AlbumView::startDrag( Qt::DropActions supportedActions ) +GridView::startDrag( Qt::DropActions supportedActions ) { QList pindexes; QModelIndexList indexes; @@ -265,7 +265,7 @@ AlbumView::startDrag( Qt::DropActions supportedActions ) void -AlbumView::onCustomContextMenu( const QPoint& pos ) +GridView::onCustomContextMenu( const QPoint& pos ) { m_contextMenu->clear(); diff --git a/src/libtomahawk/playlist/GridView.h b/src/libtomahawk/playlist/GridView.h index 3ca7b8d46..715183d66 100644 --- a/src/libtomahawk/playlist/GridView.h +++ b/src/libtomahawk/playlist/GridView.h @@ -17,8 +17,8 @@ * along with Tomahawk. If not, see . */ -#ifndef ALBUMVIEW_H -#define ALBUMVIEW_H +#ifndef GRIDVIEW_H +#define GRIDVIEW_H #include #include @@ -38,13 +38,13 @@ class AnimatedSpinner; class AlbumItemDelegate; class PlayableModel; -class DLLEXPORT AlbumView : public QListView, public Tomahawk::ViewPage +class DLLEXPORT GridView : public QListView, public Tomahawk::ViewPage { Q_OBJECT public: - explicit AlbumView( QWidget* parent = 0 ); - ~AlbumView(); + explicit GridView( QWidget* parent = 0 ); + ~GridView(); void setProxyModel( PlayableProxyModel* model ); @@ -106,4 +106,4 @@ private: QRect m_paintRect; }; -#endif // ALBUMVIEW_H +#endif // GRIDVIEW_H diff --git a/src/libtomahawk/widgets/NewReleasesWidget.ui b/src/libtomahawk/widgets/NewReleasesWidget.ui index 1dc057717..f1e8a1b9e 100644 --- a/src/libtomahawk/widgets/NewReleasesWidget.ui +++ b/src/libtomahawk/widgets/NewReleasesWidget.ui @@ -16,7 +16,7 @@ - + true @@ -29,9 +29,9 @@ - AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
Tomahawk::Breadcrumb diff --git a/src/libtomahawk/widgets/SearchWidget.ui b/src/libtomahawk/widgets/SearchWidget.ui index d1f81af0c..e2df0a078 100644 --- a/src/libtomahawk/widgets/SearchWidget.ui +++ b/src/libtomahawk/widgets/SearchWidget.ui @@ -29,8 +29,8 @@ 1 - - + + @@ -44,9 +44,9 @@
playlist/PlaylistView.h
- AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
diff --git a/src/libtomahawk/widgets/SocialPlaylistWidget.ui b/src/libtomahawk/widgets/SocialPlaylistWidget.ui index bf1015e98..1dfc5327b 100644 --- a/src/libtomahawk/widgets/SocialPlaylistWidget.ui +++ b/src/libtomahawk/widgets/SocialPlaylistWidget.ui @@ -36,7 +36,7 @@
- + @@ -92,9 +92,9 @@
widgets/HeaderLabel.h
- AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
PlaylistWidget diff --git a/src/libtomahawk/widgets/WelcomeWidget.ui b/src/libtomahawk/widgets/WelcomeWidget.ui index a46ad774f..e91e39612 100644 --- a/src/libtomahawk/widgets/WelcomeWidget.ui +++ b/src/libtomahawk/widgets/WelcomeWidget.ui @@ -36,7 +36,7 @@ - + true @@ -94,9 +94,9 @@
widgets/HeaderLabel.h
- AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
PlaylistView diff --git a/src/libtomahawk/widgets/WhatsHotWidget.ui b/src/libtomahawk/widgets/WhatsHotWidget.ui index 95e51f4d3..b684f1566 100644 --- a/src/libtomahawk/widgets/WhatsHotWidget.ui +++ b/src/libtomahawk/widgets/WhatsHotWidget.ui @@ -47,7 +47,7 @@ - + true @@ -64,9 +64,9 @@ - AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
ArtistView diff --git a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.ui index 9ad34c135..61107dc20 100644 --- a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.ui +++ b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.ui @@ -33,7 +33,7 @@
- +
@@ -53,9 +53,9 @@
ArtistView.h
- AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui index d7ca40046..e882b823b 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui @@ -57,7 +57,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -114,9 +114,9 @@
ArtistView.h
- AlbumView + GridView QListView -
AlbumView.h
+
GridView.h
diff --git a/src/libtomahawk/widgets/infowidgets/SourceInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/SourceInfoWidget.ui index 2af3656d0..de7638fff 100644 --- a/src/libtomahawk/widgets/infowidgets/SourceInfoWidget.ui +++ b/src/libtomahawk/widgets/infowidgets/SourceInfoWidget.ui @@ -32,7 +32,7 @@ - + 0 @@ -107,9 +107,9 @@
widgets/HeaderLabel.h
- AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
PlaylistView diff --git a/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui index 4814e2de0..8aeba01e2 100644 --- a/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui +++ b/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui @@ -208,7 +208,7 @@
- + 0 @@ -224,9 +224,9 @@ - AlbumView + GridView QListView -
playlist/AlbumView.h
+
playlist/GridView.h
HeaderLabel