mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 16:14:40 +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
|
||||
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 );
|
||||
req->enqueue();
|
||||
|
||||
connect( collection.data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
|
||||
setIcon( collection->bigIcon() );
|
||||
setTitle( collection->prettyName() );
|
||||
setDescription( collection->description() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TreeModel::reloadCollection()
|
||||
{
|
||||
if ( m_collection.isNull() )
|
||||
return;
|
||||
|
||||
if ( !isLoading() )
|
||||
onCollectionChanged();
|
||||
}
|
||||
|
||||
|
||||
//void
|
||||
//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
|
||||
TreeModel::onArtistsAdded( const QList<Tomahawk::artist_ptr>& artists )
|
||||
{
|
||||
|
@@ -51,7 +51,6 @@ public:
|
||||
|
||||
Tomahawk::collection_ptr collection() const;
|
||||
|
||||
void addAllCollections();
|
||||
void addCollection( const Tomahawk::collection_ptr& collection );
|
||||
//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 );
|
||||
@@ -71,7 +70,6 @@ public:
|
||||
|
||||
public slots:
|
||||
void addAlbums( const QModelIndex& parent, const QList<Tomahawk::album_ptr>& albums );
|
||||
void reloadCollection();
|
||||
|
||||
signals:
|
||||
void modeChanged( Tomahawk::ModelMode mode );
|
||||
@@ -86,9 +84,6 @@ private slots:
|
||||
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 onSourceAdded( const Tomahawk::source_ptr& source );
|
||||
void onCollectionChanged();
|
||||
|
||||
private:
|
||||
Tomahawk::ModelMode m_mode;
|
||||
Tomahawk::collection_ptr m_collection;
|
||||
|
Reference in New Issue
Block a user