1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-01 14:42:25 +02:00

* Resolved a bunch of hidden overloaded virtual methods in PlayableModel.

This commit is contained in:
Christian Muehlhaeuser 2012-06-29 02:25:35 +02:00
parent fdcd2aa728
commit bbc851fca2
2 changed files with 18 additions and 18 deletions

View File

@ -46,7 +46,7 @@ PlayableModel::PlayableModel( QObject* parent, bool loading )
{
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ), Qt::DirectConnection );
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );
m_header << tr( "Artist" ) << tr( "Title" ) << tr( "Composer" ) << tr( "Album" ) << tr( "Track" ) << tr( "Duration" )
<< tr( "Bitrate" ) << tr( "Age" ) << tr( "Year" ) << tr( "Size" ) << tr( "Origin" ) << tr( "Score" ) << tr( "Name" );
@ -200,11 +200,11 @@ PlayableModel::queryData( const query_ptr& query, int column, int role ) const
case Album:
return query->album();
break;
case Composer:
return query->composer();
break;
case Duration:
return TomahawkUtils::timeToString( query->duration() );
break;
@ -223,7 +223,7 @@ PlayableModel::queryData( const query_ptr& query, int column, int role ) const
}
}
break;
default:
break;
}
@ -256,7 +256,7 @@ PlayableModel::queryData( const query_ptr& query, int column, int role ) const
case Score:
return query->results().first()->score();
break;
default:
break;
}
@ -305,7 +305,7 @@ PlayableModel::data( const QModelIndex& index, int role ) const
{
return albumData( entry->album(), role );
}
return QVariant();
}
@ -598,7 +598,7 @@ PlayableModel::insertInternal( const QList< T >& items, int row )
{
emit trackCountChanged( rowCount( QModelIndex() ) );
emit itemCountChanged( rowCount( QModelIndex() ) );
finishLoading();
return;
}
@ -633,12 +633,12 @@ PlayableModel::insertInternal( const QList< T >& items, int row )
void
PlayableModel::remove( int row, bool moreToCome )
{
remove( index( row, 0, QModelIndex() ), moreToCome );
removeIndex( index( row, 0, QModelIndex() ), moreToCome );
}
void
PlayableModel::remove( const QModelIndex& index, bool moreToCome )
PlayableModel::removeIndex( const QModelIndex& index, bool moreToCome )
{
if ( QThread::currentThread() != thread() )
{
@ -666,7 +666,7 @@ PlayableModel::remove( const QModelIndex& index, bool moreToCome )
void
PlayableModel::remove( const QList<QModelIndex>& indexes )
PlayableModel::removeIndexes( const QList<QModelIndex>& indexes )
{
QList<QPersistentModelIndex> pil;
foreach ( const QModelIndex& idx, indexes )
@ -674,12 +674,12 @@ PlayableModel::remove( const QList<QModelIndex>& indexes )
pil << idx;
}
remove( pil );
removeIndexes( pil );
}
void
PlayableModel::remove( const QList<QPersistentModelIndex>& indexes )
PlayableModel::removeIndexes( const QList<QPersistentModelIndex>& indexes )
{
QList<QPersistentModelIndex> finalIndexes;
foreach ( const QPersistentModelIndex index, indexes )
@ -691,7 +691,7 @@ PlayableModel::remove( const QList<QPersistentModelIndex>& indexes )
for ( int i = 0; i < finalIndexes.count(); i++ )
{
remove( finalIndexes.at( i ), i + 1 != finalIndexes.count() );
removeIndex( finalIndexes.at( i ), i + 1 != finalIndexes.count() );
}
}

View File

@ -91,7 +91,7 @@ public:
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
virtual QVariant artistData( const Tomahawk::artist_ptr& artist, int role = Qt::DisplayRole ) const;
virtual QVariant albumData( const Tomahawk::album_ptr& album, int role = Qt::DisplayRole ) const;
virtual QVariant queryData( const Tomahawk::query_ptr&, int column, int role = Qt::DisplayRole ) const;
@ -114,7 +114,7 @@ public:
QList< Tomahawk::query_ptr > queries() const;
void updateDetailedInfo( const QModelIndex& index );
QSize itemSize() const { return m_itemSize; }
void setItemSize( const QSize& size ) { m_itemSize = size; }
@ -151,9 +151,9 @@ public slots:
virtual void insert( const Tomahawk::album_ptr& album, int row = 0 );
virtual void remove( int row, bool moreToCome = false );
virtual void remove( const QModelIndex& index, bool moreToCome = false );
virtual void remove( const QList<QModelIndex>& indexes );
virtual void remove( const QList<QPersistentModelIndex>& indexes );
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
virtual void removeIndexes( const QList<QModelIndex>& indexes );
virtual void removeIndexes( const QList<QPersistentModelIndex>& indexes );
virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode /*mode*/ ) {}
virtual void setShuffled( bool /*shuffled*/ ) {}