1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 07:07:05 +02:00

* Some cleanups.

This commit is contained in:
Christian Muehlhaeuser
2011-03-07 00:50:10 +01:00
parent 12d8a892de
commit eadfd92929
4 changed files with 15 additions and 14 deletions

View File

@@ -44,9 +44,10 @@ Artist::Artist( unsigned int id, const QString& name, const Tomahawk::collection
Tomahawk::collection_ptr Tomahawk::collection_ptr
Artist::collection() const Artist::collection() const
{ {
return m_collection; return m_collection;
} }
void void
Artist::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const Tomahawk::collection_ptr& collection ) Artist::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const Tomahawk::collection_ptr& collection )
{ {

View File

@@ -23,11 +23,11 @@ public:
Artist(); Artist();
virtual ~Artist(); virtual ~Artist();
unsigned int id() const { return m_id; } unsigned int id() const { return m_id; }
QString name() const { return m_name; } QString name() const { return m_name; }
Tomahawk::collection_ptr collection() const; Tomahawk::collection_ptr collection() const;
virtual QList<Tomahawk::query_ptr> tracks(); virtual QList<Tomahawk::query_ptr> tracks();

View File

@@ -19,7 +19,7 @@ SourceList::instance()
{ {
s_instance = new SourceList(); s_instance = new SourceList();
} }
return s_instance; return s_instance;
} }
@@ -43,10 +43,10 @@ SourceList::loadSources()
{ {
qDebug() << Q_FUNC_INFO; qDebug() << Q_FUNC_INFO;
DatabaseCommand_LoadAllSources* cmd = new DatabaseCommand_LoadAllSources(); DatabaseCommand_LoadAllSources* cmd = new DatabaseCommand_LoadAllSources();
connect( cmd, SIGNAL( done( const QList<Tomahawk::source_ptr>& ) ), connect( cmd, SIGNAL( done( QList<Tomahawk::source_ptr> ) ),
SLOT( setSources( const QList<Tomahawk::source_ptr>& ) ) ); SLOT( setSources( QList<Tomahawk::source_ptr> ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) ); Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
} }
@@ -70,7 +70,7 @@ SourceList::setLocal( const Tomahawk::source_ptr& localSrc )
{ {
Q_ASSERT( localSrc->isLocal() ); Q_ASSERT( localSrc->isLocal() );
Q_ASSERT( m_local.isNull() ); Q_ASSERT( m_local.isNull() );
{ {
QMutexLocker lock( &m_mut ); QMutexLocker lock( &m_mut );
m_sources.insert( localSrc->userName(), localSrc ); m_sources.insert( localSrc->userName(), localSrc );
@@ -92,11 +92,11 @@ SourceList::add( const source_ptr& source )
if ( source->id() > 0 ) if ( source->id() > 0 )
m_sources_id2name.insert( source->id(), source->userName() ); m_sources_id2name.insert( source->id(), source->userName() );
connect( source.data(), SIGNAL( syncedWithDatabase() ), SLOT( sourceSynced() ) ); connect( source.data(), SIGNAL( syncedWithDatabase() ), SLOT( sourceSynced() ) );
collection_ptr coll( new RemoteCollection( source ) ); collection_ptr coll( new RemoteCollection( source ) );
source->addCollection( coll ); source->addCollection( coll );
source->collection()->tracks(); // source->collection()->tracks();
emit sourceAdded( source ); emit sourceAdded( source );
} }

View File

@@ -407,7 +407,7 @@ TomahawkApp::removeScriptResolver( const QString& path )
foreach( ScriptResolver* r, m_scriptResolvers ) { foreach( ScriptResolver* r, m_scriptResolvers ) {
if( r->exe() == path ) { if( r->exe() == path ) {
m_scriptResolvers.removeAll( r ); m_scriptResolvers.removeAll( r );
delete r; delete r;
return; return;
} }
@@ -422,7 +422,7 @@ TomahawkApp::initLocalCollection()
src->addCollection( coll ); src->addCollection( coll );
SourceList::instance()->setLocal( src ); SourceList::instance()->setLocal( src );
src->collection()->tracks(); // src->collection()->tracks();
// to make the stats signal be emitted by our local source // to make the stats signal be emitted by our local source
// this will update the sidebar, etc. // this will update the sidebar, etc.