mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 00:09:47 +01:00
Rename Source::collection() to Source::dbCollection().
This commit is contained in:
parent
28e681329e
commit
a767b7acc0
@ -1022,7 +1022,7 @@ TomahawkWindow::createStation()
|
||||
|
||||
if ( playlistName.isEmpty() || playlistName == title )
|
||||
{
|
||||
QList< dynplaylist_ptr > pls = SourceList::instance()->getLocal()->collection()->stations();
|
||||
QList< dynplaylist_ptr > pls = SourceList::instance()->getLocal()->dbCollection()->stations();
|
||||
QStringList titles;
|
||||
foreach ( const playlist_ptr& pl, pls )
|
||||
titles << pl->title();
|
||||
@ -1074,7 +1074,7 @@ TomahawkWindow::playlistCreateDialogFinished( int ret )
|
||||
{
|
||||
if ( playlistName.isEmpty() )
|
||||
{
|
||||
QList< playlist_ptr > pls = SourceList::instance()->getLocal()->collection()->playlists();
|
||||
QList< playlist_ptr > pls = SourceList::instance()->getLocal()->dbCollection()->playlists();
|
||||
QStringList titles;
|
||||
foreach ( const playlist_ptr& pl, pls )
|
||||
titles << pl->title();
|
||||
@ -1096,7 +1096,7 @@ TomahawkWindow::playlistCreateDialogFinished( int ret )
|
||||
// create Auto Playlist
|
||||
if ( playlistName.isEmpty() )
|
||||
{
|
||||
QList< dynplaylist_ptr > pls = SourceList::instance()->getLocal()->collection()->autoPlaylists();
|
||||
QList< dynplaylist_ptr > pls = SourceList::instance()->getLocal()->dbCollection()->autoPlaylists();
|
||||
QStringList titles;
|
||||
foreach ( const dynplaylist_ptr& pl, pls )
|
||||
titles << pl->title();
|
||||
|
@ -47,8 +47,8 @@ EchonestCatalogSynchronizer::EchonestCatalogSynchronizer( QObject *parent )
|
||||
qRegisterMetaType<QList<QStringList> >("QList<QStringList>");
|
||||
|
||||
connect( TomahawkSettings::instance(), SIGNAL( changed() ), this, SLOT( checkSettingsChanged() ) );
|
||||
connect( SourceList::instance()->getLocal()->collection().data(), SIGNAL( tracksAdded( QList<unsigned int> ) ), this, SLOT( tracksAdded( QList<unsigned int> ) ), Qt::QueuedConnection );
|
||||
connect( SourceList::instance()->getLocal()->collection().data(), SIGNAL( tracksRemoved( QList<unsigned int> ) ), this, SLOT( tracksRemoved( QList<unsigned int> ) ), Qt::QueuedConnection );
|
||||
connect( SourceList::instance()->getLocal()->dbCollection().data(), SIGNAL( tracksAdded( QList<unsigned int> ) ), this, SLOT( tracksAdded( QList<unsigned int> ) ), Qt::QueuedConnection );
|
||||
connect( SourceList::instance()->getLocal()->dbCollection().data(), SIGNAL( tracksRemoved( QList<unsigned int> ) ), this, SLOT( tracksRemoved( QList<unsigned int> ) ), Qt::QueuedConnection );
|
||||
|
||||
const QByteArray artist = TomahawkSettings::instance()->value( "collection/artistCatalog" ).toByteArray();
|
||||
const QByteArray song = TomahawkSettings::instance()->value( "collection/songCatalog" ).toByteArray();
|
||||
|
@ -1207,7 +1207,7 @@ bool GlobalActionManager::handleBookmarkCommand(const QUrl& url)
|
||||
Pipeline::instance()->resolve( q, true );
|
||||
|
||||
// now we add it to the special "bookmarks" playlist, creating it if it doesn't exist. if nothing is playing, start playing the track
|
||||
QSharedPointer< LocalCollection > col = SourceList::instance()->getLocal()->collection().dynamicCast< LocalCollection >();
|
||||
QSharedPointer< LocalCollection > col = SourceList::instance()->getLocal()->dbCollection().dynamicCast< LocalCollection >();
|
||||
playlist_ptr bookmarkpl = col->bookmarksPlaylist();
|
||||
if ( bookmarkpl.isNull() )
|
||||
{
|
||||
|
@ -217,7 +217,7 @@ Playlist::load( const QString& guid )
|
||||
|
||||
foreach( const Tomahawk::source_ptr& source, SourceList::instance()->sources() )
|
||||
{
|
||||
p = source->collection()->playlist( guid );
|
||||
p = source->dbCollection()->playlist( guid );
|
||||
if ( !p.isNull() )
|
||||
return p;
|
||||
}
|
||||
@ -265,7 +265,7 @@ void
|
||||
Playlist::reportCreated( const playlist_ptr& self )
|
||||
{
|
||||
Q_ASSERT( self.data() == this );
|
||||
m_source->collection()->addPlaylist( self );
|
||||
m_source->dbCollection()->addPlaylist( self );
|
||||
}
|
||||
|
||||
|
||||
@ -280,7 +280,7 @@ Playlist::reportDeleted( const Tomahawk::playlist_ptr& self )
|
||||
}
|
||||
|
||||
m_deleted = true;
|
||||
m_source->collection()->deletePlaylist( self );
|
||||
m_source->dbCollection()->deletePlaylist( self );
|
||||
|
||||
emit deleted( self );
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ Source::peerInfos() const
|
||||
|
||||
|
||||
collection_ptr
|
||||
Source::collection() const
|
||||
Source::dbCollection() const
|
||||
{
|
||||
if ( m_collections.length() )
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
QPixmap avatar( TomahawkUtils::ImageMode style = TomahawkUtils::Original, const QSize& size = QSize() );
|
||||
#endif
|
||||
|
||||
collection_ptr collection() const;
|
||||
collection_ptr dbCollection() const;
|
||||
void addCollection( const Tomahawk::collection_ptr& c );
|
||||
void removeCollection( const Tomahawk::collection_ptr& c );
|
||||
|
||||
|
@ -333,9 +333,9 @@ ViewManager::showSuperCollection()
|
||||
|
||||
foreach( const Tomahawk::source_ptr& source, SourceList::instance()->sources() )
|
||||
{
|
||||
if ( !m_superCollections.contains( source->collection() ) )
|
||||
if ( !m_superCollections.contains( source->dbCollection() ) )
|
||||
{
|
||||
m_superCollections.append( source->collection() );
|
||||
m_superCollections.append( source->dbCollection() );
|
||||
// m_superAlbumModel->addCollection( source->collection() );
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ DatabaseCommand_AddFiles::postCommitHook()
|
||||
{
|
||||
// make the collection object emit its tracksAdded signal, so the
|
||||
// collection browser will update/fade in etc.
|
||||
Collection* coll = source()->collection().data();
|
||||
Collection* coll = source()->dbCollection().data();
|
||||
|
||||
connect( this, SIGNAL( notify( QList<unsigned int> ) ),
|
||||
coll, SLOT( setTracks( QList<unsigned int> ) ), Qt::QueuedConnection );
|
||||
@ -166,5 +166,5 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
|
||||
qDebug() << "Inserted" << added << "tracks to database";
|
||||
tDebug() << "Committing" << added << "tracks...";
|
||||
|
||||
emit done( m_files, source()->collection() );
|
||||
emit done( m_files, source()->dbCollection() );
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
|
||||
result->setDiscNumber( query.value( 12 ).toUInt() );
|
||||
result->setAlbumPos( query.value( 13 ).toUInt() );
|
||||
result->setScore( 1.0 );
|
||||
result->setCollection( s->collection() );
|
||||
result->setCollection( s->dbCollection() );
|
||||
|
||||
TomahawkSqlQuery attrQuery = dbi->newquery();
|
||||
QVariantMap attr;
|
||||
|
@ -102,7 +102,7 @@ void
|
||||
DatabaseCommand_CreateDynamicPlaylist::postCommitHook()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( source().isNull() || source()->collection().isNull() )
|
||||
if ( source().isNull() || source()->dbCollection().isNull() )
|
||||
{
|
||||
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||
return;
|
||||
|
@ -52,15 +52,15 @@ void
|
||||
DatabaseCommand_DeleteDynamicPlaylist::postCommitHook()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << "..reporting..:" << m_playlistguid;
|
||||
if ( source().isNull() || source()->collection().isNull() )
|
||||
if ( source().isNull() || source()->dbCollection().isNull() )
|
||||
{
|
||||
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||
return;
|
||||
}
|
||||
// we arent sure which it is, but it can't be more th an one. so try both
|
||||
dynplaylist_ptr playlist = source()->collection()->autoPlaylist( m_playlistguid );
|
||||
dynplaylist_ptr playlist = source()->dbCollection()->autoPlaylist( m_playlistguid );
|
||||
if( playlist.isNull() )
|
||||
playlist = source()->collection()->station( m_playlistguid );
|
||||
playlist = source()->dbCollection()->station( m_playlistguid );
|
||||
|
||||
tLog( LOGVERBOSE ) << "Just tried to load playlist for deletion:" << m_playlistguid << "Did we get a null one?" << playlist.isNull();
|
||||
Q_ASSERT( !playlist.isNull() );
|
||||
|
@ -43,7 +43,7 @@ DatabaseCommand_DeleteFiles::postCommitHook()
|
||||
|
||||
// make the collection object emit its tracksAdded signal, so the
|
||||
// collection browser will update/fade in etc.
|
||||
Collection* coll = source()->collection().data();
|
||||
Collection* coll = source()->dbCollection().data();
|
||||
|
||||
connect( this, SIGNAL( notify( QList<unsigned int> ) ),
|
||||
coll, SLOT( delTracks( QList<unsigned int> ) ), Qt::QueuedConnection );
|
||||
@ -136,5 +136,5 @@ DatabaseCommand_DeleteFiles::exec( DatabaseImpl* dbi )
|
||||
if ( m_idList.count() )
|
||||
source()->updateIndexWhenSynced();
|
||||
|
||||
emit done( m_idList, source()->collection() );
|
||||
emit done( m_idList, source()->dbCollection() );
|
||||
}
|
||||
|
@ -53,13 +53,13 @@ void
|
||||
DatabaseCommand_DeletePlaylist::postCommitHook()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << "..reporting..";
|
||||
if ( source().isNull() || source()->collection().isNull() )
|
||||
if ( source().isNull() || source()->dbCollection().isNull() )
|
||||
{
|
||||
qDebug() << "Source has gone offline, not emitting to GUI.";
|
||||
return;
|
||||
}
|
||||
|
||||
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
||||
playlist_ptr playlist = source()->dbCollection()->playlist( m_playlistguid );
|
||||
Q_ASSERT( !playlist.isNull() );
|
||||
|
||||
playlist->reportDeleted( playlist );
|
||||
|
@ -58,12 +58,12 @@ DatabaseCommand_RenamePlaylist::exec( DatabaseImpl* lib )
|
||||
void
|
||||
DatabaseCommand_RenamePlaylist::postCommitHook()
|
||||
{
|
||||
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
||||
playlist_ptr playlist = source()->dbCollection()->playlist( m_playlistguid );
|
||||
// fallback, check for auto and stations too
|
||||
if( playlist.isNull() )
|
||||
playlist = source()->collection()->autoPlaylist( m_playlistguid );
|
||||
playlist = source()->dbCollection()->autoPlaylist( m_playlistguid );
|
||||
if( playlist.isNull() )
|
||||
playlist = source()->collection()->station( m_playlistguid );
|
||||
playlist = source()->dbCollection()->station( m_playlistguid );
|
||||
|
||||
Q_ASSERT( !playlist.isNull() );
|
||||
|
||||
|
@ -182,7 +182,7 @@ DatabaseCommand_Resolve::resolve( DatabaseImpl* lib )
|
||||
}
|
||||
|
||||
result->setAttributes( attr );
|
||||
result->setCollection( s->collection() );
|
||||
result->setCollection( s->dbCollection() );
|
||||
|
||||
res << result;
|
||||
}
|
||||
@ -330,7 +330,7 @@ DatabaseCommand_Resolve::fullTextResolve( DatabaseImpl* lib )
|
||||
}
|
||||
|
||||
result->setAttributes( attr );
|
||||
result->setCollection( s->collection() );
|
||||
result->setCollection( s->dbCollection() );
|
||||
|
||||
res << result;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ DatabaseCommand_SetDynamicPlaylistRevision::controlsV()
|
||||
void
|
||||
DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
||||
{
|
||||
if ( source().isNull() || source()->collection().isNull() )
|
||||
if ( source().isNull() || source()->dbCollection().isNull() )
|
||||
{
|
||||
tDebug() << "Source has gone offline, not emitting to GUI.";
|
||||
return;
|
||||
@ -97,13 +97,13 @@ DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
||||
orderedentriesguids << v.toString();
|
||||
|
||||
Q_ASSERT( !source().isNull() );
|
||||
Q_ASSERT( !source()->collection().isNull() );
|
||||
Q_ASSERT( !source()->dbCollection().isNull() );
|
||||
tLog() << "Postcommitting this playlist:" << playlistguid() << source().isNull();
|
||||
|
||||
// private, but we are a friend. will recall itself in its own thread:
|
||||
dynplaylist_ptr playlist = source()->collection()->autoPlaylist( playlistguid() );
|
||||
dynplaylist_ptr playlist = source()->dbCollection()->autoPlaylist( playlistguid() );
|
||||
if ( playlist.isNull() )
|
||||
playlist = source()->collection()->station( playlistguid() );
|
||||
playlist = source()->dbCollection()->station( playlistguid() );
|
||||
// UGH we don't have a sharedptr from DynamicPlaylist+
|
||||
|
||||
DynamicPlaylist* rawPl = playlist.data();
|
||||
@ -112,7 +112,7 @@ DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
||||
|
||||
if ( rawPl == 0 )
|
||||
{
|
||||
tLog() <<"Got null playlist with guid:" << playlistguid() << "from source and collection:" << source()->friendlyName() << source()->collection()->name() << "and mode is static?:" << (m_mode == Static);
|
||||
tLog() <<"Got null playlist with guid:" << playlistguid() << "from source and collection:" << source()->friendlyName() << source()->dbCollection()->name() << "and mode is static?:" << (m_mode == Static);
|
||||
Q_ASSERT( false );
|
||||
return;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ DatabaseCommand_SetPlaylistRevision::postCommitHook()
|
||||
orderedentriesguids << v.toString();
|
||||
|
||||
// private, but we are a friend. will recall itself in its own thread:
|
||||
playlist_ptr playlist = source()->collection()->playlist( m_playlistguid );
|
||||
playlist_ptr playlist = source()->dbCollection()->playlist( m_playlistguid );
|
||||
if ( playlist.isNull() )
|
||||
{
|
||||
Q_ASSERT( !playlist.isNull() );
|
||||
|
@ -311,7 +311,7 @@ DatabaseImpl::file( int fid )
|
||||
r->setComposer( composer );
|
||||
r->setTrack( query.value( 13 ).toString() );
|
||||
r->setTrackId( query.value( 9 ).toUInt() );
|
||||
r->setCollection( s->collection() );
|
||||
r->setCollection( s->dbCollection() );
|
||||
r->setScore( 1.0 );
|
||||
r->setFileId( fid );
|
||||
}
|
||||
@ -713,7 +713,7 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
||||
res->setDiscNumber( query.value( 17 ).toUInt() );
|
||||
res->setRID( uuid() );
|
||||
res->setTrackId( query.value( 9 ).toUInt() );
|
||||
res->setCollection( s->collection() );
|
||||
res->setCollection( s->dbCollection() );
|
||||
res->setYear( query.value( 21 ).toUInt() );
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ AlbumModel::addCollection( const collection_ptr& collection, bool overwrite )
|
||||
QList<Tomahawk::source_ptr> sources = SourceList::instance()->sources();
|
||||
foreach ( const source_ptr& source, sources )
|
||||
{
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -236,7 +236,7 @@ AlbumModel::addQueries( const QList<Tomahawk::query_ptr>& queries )
|
||||
void
|
||||
AlbumModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ RecentlyAddedModel::loadHistory()
|
||||
}
|
||||
startLoading();
|
||||
|
||||
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_source->collection() );
|
||||
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks( m_source->dbCollection() );
|
||||
cmd->setLimit( m_limit );
|
||||
cmd->setSortOrder( DatabaseCommand_AllTracks::ModificationTime );
|
||||
cmd->setSortDescending( true );
|
||||
@ -103,7 +103,7 @@ RecentlyAddedModel::setSource( const Tomahawk::source_ptr& source )
|
||||
void
|
||||
RecentlyAddedModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( loadHistory() ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( loadHistory() ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,7 +143,7 @@ TreeModel::addAllCollections()
|
||||
QList<Tomahawk::source_ptr> sources = SourceList::instance()->sources();
|
||||
foreach ( const source_ptr& source, sources )
|
||||
{
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
setTitle( tr( "All Artists" ) );
|
||||
@ -298,7 +298,7 @@ TreeModel::addFilteredCollection( const collection_ptr& collection, unsigned int
|
||||
void
|
||||
TreeModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,9 +130,9 @@ DynamicPlaylist::load( const QString& guid )
|
||||
|
||||
foreach( const Tomahawk::source_ptr& source, SourceList::instance()->sources() )
|
||||
{
|
||||
p = source->collection()->autoPlaylist( guid );
|
||||
p = source->dbCollection()->autoPlaylist( guid );
|
||||
if ( p.isNull() )
|
||||
p = source->collection()->station( guid );
|
||||
p = source->dbCollection()->station( guid );
|
||||
|
||||
if ( !p.isNull() )
|
||||
return p;
|
||||
@ -323,14 +323,14 @@ DynamicPlaylist::reportCreated( const Tomahawk::dynplaylist_ptr& self )
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
Q_ASSERT( self.data() == this );
|
||||
Q_ASSERT( !author().isNull() );
|
||||
Q_ASSERT( !author()->collection().isNull() );
|
||||
Q_ASSERT( !author()->dbCollection().isNull() );
|
||||
// will emit Collection::playlistCreated(...)
|
||||
// qDebug() << "Creating dynplaylist belonging to:" << author().data() << author().isNull();
|
||||
// qDebug() << "REPORTING DYNAMIC PLAYLIST CREATED:" << this << author()->friendlyName();
|
||||
if ( self->mode() == Static )
|
||||
author()->collection()->addAutoPlaylist( self );
|
||||
author()->dbCollection()->addAutoPlaylist( self );
|
||||
else
|
||||
author()->collection()->addStation( self );
|
||||
author()->dbCollection()->addStation( self );
|
||||
}
|
||||
|
||||
|
||||
@ -341,9 +341,9 @@ DynamicPlaylist::reportDeleted( const Tomahawk::dynplaylist_ptr& self )
|
||||
Q_ASSERT( self.data() == this );
|
||||
// will emit Collection::playlistDeleted(...)
|
||||
if ( self->mode() == Static )
|
||||
author()->collection()->deleteAutoPlaylist( self );
|
||||
author()->dbCollection()->deleteAutoPlaylist( self );
|
||||
else
|
||||
author()->collection()->deleteStation( self );
|
||||
author()->dbCollection()->deleteStation( self );
|
||||
|
||||
emit deleted( self );
|
||||
}
|
||||
|
@ -101,11 +101,11 @@ RecentPlaylistsModel::playlistsLoaded( const QList<DatabaseCommand_LoadAllSorted
|
||||
if ( plPair.first == 0 )
|
||||
s = SourceList::instance()->getLocal();
|
||||
|
||||
playlist_ptr pl = s->collection()->playlist( plPair.second );
|
||||
playlist_ptr pl = s->dbCollection()->playlist( plPair.second );
|
||||
if ( pl.isNull() )
|
||||
pl = s->collection()->autoPlaylist( plPair.second );
|
||||
pl = s->dbCollection()->autoPlaylist( plPair.second );
|
||||
if ( pl.isNull() )
|
||||
pl = s->collection()->station( plPair.second );
|
||||
pl = s->dbCollection()->station( plPair.second );
|
||||
|
||||
if ( pl.isNull() )
|
||||
{
|
||||
@ -210,12 +210,12 @@ void
|
||||
RecentPlaylistsModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source.data(), SIGNAL( online() ), this, SLOT( sourceOnline() ) );
|
||||
connect( source->collection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ), SLOT( refresh() ), Qt::QueuedConnection );
|
||||
connect( source->collection().data(), SIGNAL( autoPlaylistsAdded(QList<Tomahawk::dynplaylist_ptr>)), SLOT( refresh() ), Qt::QueuedConnection );
|
||||
connect( source->collection().data(), SIGNAL( stationsAdded(QList<Tomahawk::dynplaylist_ptr>)), SLOT( refresh() ), Qt::QueuedConnection );
|
||||
connect( source->collection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ), SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
|
||||
connect( source->collection().data(), SIGNAL( autoPlaylistsDeleted(QList<Tomahawk::dynplaylist_ptr>) ), SLOT( onDynPlaylistsRemoved( QList<Tomahawk::dynplaylist_ptr> ) ) );
|
||||
connect( source->collection().data(), SIGNAL( stationsDeleted(QList<Tomahawk::dynplaylist_ptr>) ), SLOT( onDynPlaylistsRemoved( QList<Tomahawk::dynplaylist_ptr> ) ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ), SLOT( refresh() ), Qt::QueuedConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( autoPlaylistsAdded(QList<Tomahawk::dynplaylist_ptr>)), SLOT( refresh() ), Qt::QueuedConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( stationsAdded(QList<Tomahawk::dynplaylist_ptr>)), SLOT( refresh() ), Qt::QueuedConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ), SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( autoPlaylistsDeleted(QList<Tomahawk::dynplaylist_ptr>) ), SLOT( onDynPlaylistsRemoved( QList<Tomahawk::dynplaylist_ptr> ) ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( stationsDeleted(QList<Tomahawk::dynplaylist_ptr>) ), SLOT( onDynPlaylistsRemoved( QList<Tomahawk::dynplaylist_ptr> ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,8 +170,8 @@ void
|
||||
RecentlyPlayedPlaylistsModel::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source.data(), SIGNAL( online() ), this, SLOT( sourceOnline() ) );
|
||||
connect( source->collection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ), SLOT( loadFromSettings() ) );
|
||||
connect( source->collection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ), SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ), SLOT( loadFromSettings() ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( playlistsDeleted( QList<Tomahawk::playlist_ptr> ) ), SLOT( onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> ) ) );
|
||||
}
|
||||
|
||||
void
|
||||
@ -224,11 +224,11 @@ RecentlyPlayedPlaylistsModel::plAdded( const QString& plguid, int sId )
|
||||
if ( source.isNull() )
|
||||
return;
|
||||
|
||||
playlist_ptr pl = source->collection()->playlist( plguid );
|
||||
playlist_ptr pl = source->dbCollection()->playlist( plguid );
|
||||
if ( pl.isNull() )
|
||||
pl = source->collection()->autoPlaylist( plguid );
|
||||
pl = source->dbCollection()->autoPlaylist( plguid );
|
||||
if ( pl.isNull() )
|
||||
pl = source->collection()->station( plguid );
|
||||
pl = source->dbCollection()->station( plguid );
|
||||
|
||||
if ( pl.isNull() )
|
||||
return;
|
||||
|
@ -154,7 +154,7 @@ WelcomeWidget::onSourcesReady()
|
||||
void
|
||||
WelcomeWidget::onSourceAdded( const Tomahawk::source_ptr& source )
|
||||
{
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( updateRecentAdditions() ), Qt::UniqueConnection );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( updateRecentAdditions() ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget*
|
||||
ui->recentAlbumView->proxyModel()->sort( -1 );
|
||||
|
||||
onCollectionChanged();
|
||||
connect( source->collection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ) );
|
||||
connect( source->dbCollection().data(), SIGNAL( changed() ), SLOT( onCollectionChanged() ) );
|
||||
|
||||
m_title = tr( "New Additions" );
|
||||
if ( source->isLocal() )
|
||||
@ -95,7 +95,7 @@ SourceInfoWidget::onCollectionChanged()
|
||||
void
|
||||
SourceInfoWidget::loadRecentAdditions()
|
||||
{
|
||||
m_recentAlbumModel->addFilteredCollection( m_source->collection(), 20, DatabaseCommand_AllAlbums::ModificationTime, true );
|
||||
m_recentAlbumModel->addFilteredCollection( m_source->dbCollection(), 20, DatabaseCommand_AllAlbums::ModificationTime, true );
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,9 +88,9 @@ SourceItem::SourceItem( SourcesModel* mdl, SourceTreeItem* parent, const Tomahaw
|
||||
m_recentPlaysItem->setSortValue( -200 );
|
||||
|
||||
// create category items if there are playlists to show, or stations to show
|
||||
QList< playlist_ptr > playlists = source->collection()->playlists();
|
||||
QList< dynplaylist_ptr > autoplaylists = source->collection()->autoPlaylists();
|
||||
QList< dynplaylist_ptr > stations = source->collection()->stations();
|
||||
QList< playlist_ptr > playlists = source->dbCollection()->playlists();
|
||||
QList< dynplaylist_ptr > autoplaylists = source->dbCollection()->autoPlaylists();
|
||||
QList< dynplaylist_ptr > stations = source->dbCollection()->stations();
|
||||
|
||||
if ( !playlists.isEmpty() || !autoplaylists.isEmpty() || source->isLocal() )
|
||||
{
|
||||
@ -117,11 +117,11 @@ SourceItem::SourceItem( SourcesModel* mdl, SourceTreeItem* parent, const Tomahaw
|
||||
connect( SourceList::instance(), SIGNAL( sourceLatchedOn( Tomahawk::source_ptr, Tomahawk::source_ptr ) ), SLOT( latchedOn( Tomahawk::source_ptr, Tomahawk::source_ptr ) ) );
|
||||
connect( SourceList::instance(), SIGNAL( sourceLatchedOff( Tomahawk::source_ptr, Tomahawk::source_ptr ) ), SLOT( latchedOff( Tomahawk::source_ptr, Tomahawk::source_ptr ) ) );
|
||||
|
||||
connect( source->collection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ),
|
||||
connect( source->dbCollection().data(), SIGNAL( playlistsAdded( QList<Tomahawk::playlist_ptr> ) ),
|
||||
SLOT( onPlaylistsAdded( QList<Tomahawk::playlist_ptr> ) ), Qt::QueuedConnection );
|
||||
connect( source->collection().data(), SIGNAL( autoPlaylistsAdded( QList< Tomahawk::dynplaylist_ptr > ) ),
|
||||
connect( source->dbCollection().data(), SIGNAL( autoPlaylistsAdded( QList< Tomahawk::dynplaylist_ptr > ) ),
|
||||
SLOT( onAutoPlaylistsAdded( QList<Tomahawk::dynplaylist_ptr> ) ), Qt::QueuedConnection );
|
||||
connect( source->collection().data(), SIGNAL( stationsAdded( QList<Tomahawk::dynplaylist_ptr> ) ),
|
||||
connect( source->dbCollection().data(), SIGNAL( stationsAdded( QList<Tomahawk::dynplaylist_ptr> ) ),
|
||||
SLOT( onStationsAdded( QList<Tomahawk::dynplaylist_ptr> ) ), Qt::QueuedConnection );
|
||||
|
||||
if ( m_source->isLocal() )
|
||||
@ -503,7 +503,7 @@ SourceItem::collectionClicked()
|
||||
if ( m_source.isNull() )
|
||||
return 0;
|
||||
|
||||
m_collectionPage = ViewManager::instance()->show( m_source->collection() );
|
||||
m_collectionPage = ViewManager::instance()->show( m_source->dbCollection() );
|
||||
return m_collectionPage;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user