Skip to content

Commit

Permalink
* Renamed Track(Proxy)Model to Playable(Proxy)Model.
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed May 21, 2012
1 parent 45397e8 commit 1b74820
Show file tree
Hide file tree
Showing 45 changed files with 216 additions and 217 deletions.
6 changes: 3 additions & 3 deletions src/libtomahawk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ set( libGuiSources
playlist/QueueProxyModel.cpp
playlist/QueueProxyModelPlaylistInterface.cpp
playlist/QueueView.cpp
playlist/TrackModel.cpp
playlist/TrackProxyModel.cpp
playlist/TrackProxyModelPlaylistInterface.cpp
playlist/PlayableModel.cpp
playlist/PlayableProxyModel.cpp
playlist/PlayableProxyModelPlaylistInterface.cpp
playlist/TrackView.cpp
playlist/TrackHeader.cpp
playlist/AlbumModel.cpp
Expand Down
8 changes: 4 additions & 4 deletions src/libtomahawk/ViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include "CollectionView.h"
#include "PlaylistModel.h"
#include "PlaylistView.h"
#include "TrackProxyModel.h"
#include "TrackModel.h"
#include "PlayableProxyModel.h"
#include "PlayableModel.h"
#include "ArtistView.h"
#include "AlbumView.h"
#include "AlbumProxyModel.h"
Expand Down Expand Up @@ -289,7 +289,7 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
{
view = new CollectionView();
CollectionFlatModel* model = new CollectionFlatModel();
view->setTrackModel( model );
view->setPlayableModel( model );
view->setFrameShape( QFrame::NoFrame );
view->setAttribute( Qt::WA_MacShowFocusRect, 0 );

Expand Down Expand Up @@ -496,7 +496,7 @@ ViewManager::showRecentPlaysPage()
RecentlyPlayedModel* raModel = new RecentlyPlayedModel( source_ptr(), pv );
raModel->setTitle( tr( "Recently Played Tracks" ) );
raModel->setDescription( tr( "Recently played tracks from all your friends" ) );
raModel->setStyle( TrackModel::Large );
raModel->setStyle( PlayableModel::Large );

PlaylistLargeItemDelegate* del = new PlaylistLargeItemDelegate( PlaylistLargeItemDelegate::RecentlyPlayed, pv, pv->proxyModel() );
connect( del, SIGNAL( updateIndex( QModelIndex ) ), pv, SLOT( update( QModelIndex ) ) );
Expand Down
2 changes: 1 addition & 1 deletion src/libtomahawk/context/pages/TopTracksContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TopTracksContext::TopTracksContext()
m_topHitsView->setGuid( "TopTracksContext" );
m_topHitsView->setUpdatesContextView( false );
m_topHitsModel = new PlaylistModel( m_topHitsView );
m_topHitsModel->setStyle( TrackModel::Short );
m_topHitsModel->setStyle( PlayableModel::Short );
m_topHitsView->setPlaylistModel( m_topHitsModel );
m_topHitsView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );

Expand Down
2 changes: 1 addition & 1 deletion src/libtomahawk/playlist/CollectionFlatModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace Tomahawk;


CollectionFlatModel::CollectionFlatModel( QObject* parent )
: TrackModel( parent )
: PlayableModel( parent )
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/libtomahawk/playlist/CollectionFlatModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <QHash>

#include "Typedefs.h"
#include "TrackModel.h"
#include "PlayableModel.h"
#include "Query.h"
#include "Source.h"
#include "PlaylistInterface.h"
Expand All @@ -36,7 +36,7 @@

class QMetaData;

class DLLEXPORT CollectionFlatModel : public TrackModel
class DLLEXPORT CollectionFlatModel : public PlayableModel
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion src/libtomahawk/playlist/CollectionProxyModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


CollectionProxyModel::CollectionProxyModel( QObject* parent )
: TrackProxyModel( parent )
: PlayableProxyModel( parent )
{
}

Expand Down
6 changes: 3 additions & 3 deletions src/libtomahawk/playlist/CollectionProxyModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#ifndef COLLECTIONPROXYMODEL_H
#define COLLECTIONPROXYMODEL_H

#include "TrackProxyModel.h"
#include "TrackProxyModelPlaylistInterface.h"
#include "PlayableProxyModel.h"
#include "PlayableProxyModelPlaylistInterface.h"

#include "DllMacro.h"

class DLLEXPORT CollectionProxyModel : public TrackProxyModel
class DLLEXPORT CollectionProxyModel : public PlayableProxyModel
{
Q_OBJECT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
using namespace Tomahawk;

CollectionProxyModelPlaylistInterface::CollectionProxyModelPlaylistInterface( CollectionProxyModel *proxyModel )
: TrackProxyModelPlaylistInterface( proxyModel )
: PlayableProxyModelPlaylistInterface( proxyModel )
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#ifndef COLLECTIONPROXYMODELPLAYLISTINTERFACE_H
#define COLLECTIONPROXYMODELPLAYLISTINTERFACE_H

#include "TrackProxyModel.h"
#include "TrackProxyModelPlaylistInterface.h"
#include "PlayableProxyModel.h"
#include "PlayableProxyModelPlaylistInterface.h"

#include "DllMacro.h"

Expand All @@ -30,7 +30,7 @@ class CollectionProxyModel;
namespace Tomahawk
{

class DLLEXPORT CollectionProxyModelPlaylistInterface : public TrackProxyModelPlaylistInterface
class DLLEXPORT CollectionProxyModelPlaylistInterface : public PlayableProxyModelPlaylistInterface
{
Q_OBJECT

Expand Down
16 changes: 8 additions & 8 deletions src/libtomahawk/playlist/CollectionView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <QPainter>

#include "CollectionProxyModel.h"
#include "TrackModel.h"
#include "PlayableModel.h"
#include "widgets/OverlayWidget.h"
#include "utils/Logger.h"
#include "Source.h"
Expand All @@ -50,22 +50,22 @@ void
CollectionView::setModel( QAbstractItemModel* model )
{
Q_UNUSED( model );
qDebug() << "Explicitly use setTrackModel instead";
qDebug() << "Explicitly use setPlayableModel instead";
Q_ASSERT( false );
}


void
CollectionView::setTrackModel( TrackModel* model )
CollectionView::setPlayableModel( PlayableModel* model )
{
TrackView::setTrackModel( model );
TrackView::setPlayableModel( model );

setColumnHidden( TrackModel::Score, true ); // Hide score column per default
setColumnHidden( TrackModel::Origin, true ); // Hide origin column per default
setColumnHidden( TrackModel::Composer, true ); //Hide composer column per default
setColumnHidden( PlayableModel::Score, true ); // Hide score column per default
setColumnHidden( PlayableModel::Origin, true ); // Hide origin column per default
setColumnHidden( PlayableModel::Composer, true ); //Hide composer column per default

setGuid( QString( "collectionview/%1" ).arg( model->columnCount() ) );
sortByColumn( TrackModel::Artist, Qt::AscendingOrder );
sortByColumn( PlayableModel::Artist, Qt::AscendingOrder );

connect( model, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) );
}
Expand Down
7 changes: 3 additions & 4 deletions src/libtomahawk/playlist/CollectionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
#ifndef COLLECTIONVIEW_H
#define COLLECTIONVIEW_H

#include "TrackProxyModel.h"
#include "PlayableModel.h"
#include "PlayableProxyModel.h"
#include "TrackView.h"
#include "ViewPage.h"

#include "DllMacro.h"

class TrackModel;

class DLLEXPORT CollectionView : public TrackView, public Tomahawk::ViewPage
{
Q_OBJECT
Expand All @@ -36,7 +35,7 @@ Q_OBJECT
explicit CollectionView( QWidget* parent = 0 );
~CollectionView();

virtual void setTrackModel( TrackModel* model );
virtual void setPlayableModel( PlayableModel* model );
virtual void setModel( QAbstractItemModel* model );

virtual QWidget* widget() { return this; }
Expand Down
2 changes: 1 addition & 1 deletion src/libtomahawk/playlist/CustomPlaylistView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CustomPlaylistView::CustomPlaylistView( CustomPlaylistView::PlaylistType type, c
setFrameShape( QFrame::NoFrame );
setAttribute( Qt::WA_MacShowFocusRect, 0 );

m_model->setStyle( TrackModel::Large );
m_model->setStyle( PlayableModel::Large );
setPlaylistModel( m_model );
generateTracks();

Expand Down
Loading

0 comments on commit 1b74820

Please sign in to comment.