mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 09:34:53 +02:00
Removed old SuperCollection related methods in TreeModel.
This commit is contained in:
@@ -131,30 +131,6 @@ TreeModel::fetchMore( const QModelIndex& parent )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TreeModel::addAllCollections()
|
|
||||||
{
|
|
||||||
startLoading();
|
|
||||||
|
|
||||||
DatabaseCommand_AllArtists* cmd = new DatabaseCommand_AllArtists();
|
|
||||||
|
|
||||||
connect( cmd, SIGNAL( artists( QList<Tomahawk::artist_ptr> ) ),
|
|
||||||
SLOT( onArtistsAdded( QList<Tomahawk::artist_ptr> ) ) );
|
|
||||||
|
|
||||||
Database::instance()->enqueue( Tomahawk::dbcmd_ptr( cmd ) );
|
|
||||||
|
|
||||||
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ), Qt::UniqueConnection );
|
|
||||||
|
|
||||||
QList<Tomahawk::source_ptr> sources = SourceList::instance()->sources();
|
|
||||||
foreach ( const source_ptr& source, sources )
|
|
||||||
{
|
|
||||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
|
||||||
}
|
|
||||||
|
|
||||||
setTitle( tr( "All Artists" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TreeModel::addArtists( const artist_ptr& artist )
|
TreeModel::addArtists( const artist_ptr& artist )
|
||||||
{
|
{
|
||||||
@@ -262,25 +238,12 @@ TreeModel::addCollection( const collection_ptr& collection )
|
|||||||
this, SLOT( onArtistsAdded( QList< Tomahawk::artist_ptr > ) ), Qt::UniqueConnection );
|
this, SLOT( onArtistsAdded( QList< Tomahawk::artist_ptr > ) ), Qt::UniqueConnection );
|
||||||
req->enqueue();
|
req->enqueue();
|
||||||
|
|
||||||
connect( collection.data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
|
||||||
|
|
||||||
setIcon( collection->bigIcon() );
|
setIcon( collection->bigIcon() );
|
||||||
setTitle( collection->prettyName() );
|
setTitle( collection->prettyName() );
|
||||||
setDescription( collection->description() );
|
setDescription( collection->description() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TreeModel::reloadCollection()
|
|
||||||
{
|
|
||||||
if ( m_collection.isNull() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( !isLoading() )
|
|
||||||
onCollectionChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//void
|
//void
|
||||||
//TreeModel::addFilteredCollection( const collection_ptr& collection, unsigned int amount, DatabaseCommand_AllArtists::SortOrder order )
|
//TreeModel::addFilteredCollection( const collection_ptr& collection, unsigned int amount, DatabaseCommand_AllArtists::SortOrder order )
|
||||||
//{
|
//{
|
||||||
@@ -305,25 +268,6 @@ TreeModel::reloadCollection()
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TreeModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
|
||||||
{
|
|
||||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TreeModel::onCollectionChanged()
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
|
|
||||||
if ( m_collection )
|
|
||||||
addCollection( m_collection );
|
|
||||||
else
|
|
||||||
addAllCollections();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TreeModel::onArtistsAdded( const QList<Tomahawk::artist_ptr>& artists )
|
TreeModel::onArtistsAdded( const QList<Tomahawk::artist_ptr>& artists )
|
||||||
{
|
{
|
||||||
|
@@ -51,7 +51,6 @@ public:
|
|||||||
|
|
||||||
Tomahawk::collection_ptr collection() const;
|
Tomahawk::collection_ptr collection() const;
|
||||||
|
|
||||||
void addAllCollections();
|
|
||||||
void addCollection( const Tomahawk::collection_ptr& collection );
|
void addCollection( const Tomahawk::collection_ptr& collection );
|
||||||
//TODO: Unused, but will be useful for supporting filtered queries. - Teo 1/2013
|
//TODO: Unused, but will be useful for supporting filtered queries. - Teo 1/2013
|
||||||
//void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, DatabaseCommand_AllArtists::SortOrder order );
|
//void addFilteredCollection( const Tomahawk::collection_ptr& collection, unsigned int amount, DatabaseCommand_AllArtists::SortOrder order );
|
||||||
@@ -71,7 +70,6 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addAlbums( const QModelIndex& parent, const QList<Tomahawk::album_ptr>& albums );
|
void addAlbums( const QModelIndex& parent, const QList<Tomahawk::album_ptr>& albums );
|
||||||
void reloadCollection();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void modeChanged( Tomahawk::ModelMode mode );
|
void modeChanged( Tomahawk::ModelMode mode );
|
||||||
@@ -86,9 +84,6 @@ private slots:
|
|||||||
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QModelIndex& index );
|
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QModelIndex& index );
|
||||||
void onTracksFound( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, Tomahawk::collection_ptr collection );
|
void onTracksFound( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::ModelMode mode, Tomahawk::collection_ptr collection );
|
||||||
|
|
||||||
void onSourceAdded( const Tomahawk::source_ptr& source );
|
|
||||||
void onCollectionChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Tomahawk::ModelMode m_mode;
|
Tomahawk::ModelMode m_mode;
|
||||||
Tomahawk::collection_ptr m_collection;
|
Tomahawk::collection_ptr m_collection;
|
||||||
|
Reference in New Issue
Block a user