diff --git a/src/libtomahawk/playlist/TreeModel.cpp b/src/libtomahawk/playlist/TreeModel.cpp index db8e52ba4..45cbdc2b5 100644 --- a/src/libtomahawk/playlist/TreeModel.cpp +++ b/src/libtomahawk/playlist/TreeModel.cpp @@ -131,30 +131,6 @@ TreeModel::fetchMore( const QModelIndex& parent ) } -void -TreeModel::addAllCollections() -{ - startLoading(); - - DatabaseCommand_AllArtists* cmd = new DatabaseCommand_AllArtists(); - - connect( cmd, SIGNAL( artists( QList ) ), - SLOT( onArtistsAdded( QList ) ) ); - - Database::instance()->enqueue( Tomahawk::dbcmd_ptr( cmd ) ); - - connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ), Qt::UniqueConnection ); - - QList 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& artists ) { diff --git a/src/libtomahawk/playlist/TreeModel.h b/src/libtomahawk/playlist/TreeModel.h index 73634887b..e0a64d617 100644 --- a/src/libtomahawk/playlist/TreeModel.h +++ b/src/libtomahawk/playlist/TreeModel.h @@ -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& albums ); - void reloadCollection(); signals: void modeChanged( Tomahawk::ModelMode mode ); @@ -86,9 +84,6 @@ private slots: void onTracksAdded( const QList& tracks, const QModelIndex& index ); void onTracksFound( const QList& 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;