mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 23:57:34 +02:00
* Resolved a bunch of hidden overloaded virtual methods in PlayableModel.
This commit is contained in:
@@ -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( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ), Qt::DirectConnection );
|
||||||
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), 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" )
|
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" );
|
<< 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:
|
case Album:
|
||||||
return query->album();
|
return query->album();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Composer:
|
case Composer:
|
||||||
return query->composer();
|
return query->composer();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Duration:
|
case Duration:
|
||||||
return TomahawkUtils::timeToString( query->duration() );
|
return TomahawkUtils::timeToString( query->duration() );
|
||||||
break;
|
break;
|
||||||
@@ -223,7 +223,7 @@ PlayableModel::queryData( const query_ptr& query, int column, int role ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,7 @@ PlayableModel::queryData( const query_ptr& query, int column, int role ) const
|
|||||||
case Score:
|
case Score:
|
||||||
return query->results().first()->score();
|
return query->results().first()->score();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -305,7 +305,7 @@ PlayableModel::data( const QModelIndex& index, int role ) const
|
|||||||
{
|
{
|
||||||
return albumData( entry->album(), role );
|
return albumData( entry->album(), role );
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,7 +598,7 @@ PlayableModel::insertInternal( const QList< T >& items, int row )
|
|||||||
{
|
{
|
||||||
emit trackCountChanged( rowCount( QModelIndex() ) );
|
emit trackCountChanged( rowCount( QModelIndex() ) );
|
||||||
emit itemCountChanged( rowCount( QModelIndex() ) );
|
emit itemCountChanged( rowCount( QModelIndex() ) );
|
||||||
|
|
||||||
finishLoading();
|
finishLoading();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -633,12 +633,12 @@ PlayableModel::insertInternal( const QList< T >& items, int row )
|
|||||||
void
|
void
|
||||||
PlayableModel::remove( int row, bool moreToCome )
|
PlayableModel::remove( int row, bool moreToCome )
|
||||||
{
|
{
|
||||||
remove( index( row, 0, QModelIndex() ), moreToCome );
|
removeIndex( index( row, 0, QModelIndex() ), moreToCome );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::remove( const QModelIndex& index, bool moreToCome )
|
PlayableModel::removeIndex( const QModelIndex& index, bool moreToCome )
|
||||||
{
|
{
|
||||||
if ( QThread::currentThread() != thread() )
|
if ( QThread::currentThread() != thread() )
|
||||||
{
|
{
|
||||||
@@ -666,7 +666,7 @@ PlayableModel::remove( const QModelIndex& index, bool moreToCome )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::remove( const QList<QModelIndex>& indexes )
|
PlayableModel::removeIndexes( const QList<QModelIndex>& indexes )
|
||||||
{
|
{
|
||||||
QList<QPersistentModelIndex> pil;
|
QList<QPersistentModelIndex> pil;
|
||||||
foreach ( const QModelIndex& idx, indexes )
|
foreach ( const QModelIndex& idx, indexes )
|
||||||
@@ -674,12 +674,12 @@ PlayableModel::remove( const QList<QModelIndex>& indexes )
|
|||||||
pil << idx;
|
pil << idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
remove( pil );
|
removeIndexes( pil );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlayableModel::remove( const QList<QPersistentModelIndex>& indexes )
|
PlayableModel::removeIndexes( const QList<QPersistentModelIndex>& indexes )
|
||||||
{
|
{
|
||||||
QList<QPersistentModelIndex> finalIndexes;
|
QList<QPersistentModelIndex> finalIndexes;
|
||||||
foreach ( const QPersistentModelIndex index, indexes )
|
foreach ( const QPersistentModelIndex index, indexes )
|
||||||
@@ -691,7 +691,7 @@ PlayableModel::remove( const QList<QPersistentModelIndex>& indexes )
|
|||||||
|
|
||||||
for ( int i = 0; i < finalIndexes.count(); i++ )
|
for ( int i = 0; i < finalIndexes.count(); i++ )
|
||||||
{
|
{
|
||||||
remove( finalIndexes.at( i ), i + 1 != finalIndexes.count() );
|
removeIndex( finalIndexes.at( i ), i + 1 != finalIndexes.count() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
|
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
|
||||||
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) 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 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 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;
|
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;
|
QList< Tomahawk::query_ptr > queries() const;
|
||||||
|
|
||||||
void updateDetailedInfo( const QModelIndex& index );
|
void updateDetailedInfo( const QModelIndex& index );
|
||||||
|
|
||||||
QSize itemSize() const { return m_itemSize; }
|
QSize itemSize() const { return m_itemSize; }
|
||||||
void setItemSize( const QSize& size ) { m_itemSize = size; }
|
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 insert( const Tomahawk::album_ptr& album, int row = 0 );
|
||||||
|
|
||||||
virtual void remove( int row, bool moreToCome = false );
|
virtual void remove( int row, bool moreToCome = false );
|
||||||
virtual void remove( const QModelIndex& index, bool moreToCome = false );
|
virtual void removeIndex( const QModelIndex& index, bool moreToCome = false );
|
||||||
virtual void remove( const QList<QModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QModelIndex>& indexes );
|
||||||
virtual void remove( const QList<QPersistentModelIndex>& indexes );
|
virtual void removeIndexes( const QList<QPersistentModelIndex>& indexes );
|
||||||
|
|
||||||
virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode /*mode*/ ) {}
|
virtual void setRepeatMode( Tomahawk::PlaylistModes::RepeatMode /*mode*/ ) {}
|
||||||
virtual void setShuffled( bool /*shuffled*/ ) {}
|
virtual void setShuffled( bool /*shuffled*/ ) {}
|
||||||
|
Reference in New Issue
Block a user