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

* InfoSystem now emits ready() when init is done.

This commit is contained in:
Christian Muehlhaeuser
2013-06-07 11:54:48 +02:00
parent 9e89e4aa4c
commit 13ae09218d
3 changed files with 26 additions and 20 deletions

View File

@@ -80,6 +80,7 @@ InfoPlugin::setFriendlyName( const QString& friendlyName )
m_friendlyName = friendlyName; m_friendlyName = friendlyName;
} }
const QString const QString
InfoPlugin::friendlyName() const InfoPlugin::friendlyName() const
{ {
@@ -182,6 +183,7 @@ InfoSystem::init()
QMetaObject::invokeMethod( worker, "init", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoSystemCache*, cache ) ); QMetaObject::invokeMethod( worker, "init", Qt::QueuedConnection, Q_ARG( Tomahawk::InfoSystem::InfoSystemCache*, cache ) );
m_inited = true; m_inited = true;
emit ready();
} }
@@ -211,7 +213,7 @@ InfoSystem::getInfo( const QString &caller, const QVariantMap &customData, const
requestData.caller = caller; requestData.caller = caller;
requestData.customData = customData; requestData.customData = customData;
requestData.allSources = allSources; requestData.allSources = allSources;
Q_FOREACH( InfoType type, inputMap.keys() ) foreach ( InfoType type, inputMap.keys() )
{ {
requestData.type = type; requestData.type = type;
requestData.input = inputMap[ type ]; requestData.input = inputMap[ type ];
@@ -249,7 +251,7 @@ InfoSystem::pushInfo( const QString &caller, const InfoTypeMap &input, const Pus
return false; return false;
} }
Q_FOREACH( InfoType type, input.keys() ) foreach ( InfoType type, input.keys() )
{ {
InfoPushData pushData( caller, type, input[ type ], pushFlags ); InfoPushData pushData( caller, type, input[ type ], pushFlags );
pushData.infoPair = PushInfoPair( QVariantMap(), pushData.input ); pushData.infoPair = PushInfoPair( QVariantMap(), pushData.input );
@@ -379,11 +381,13 @@ InfoSystemWorkerThread::InfoSystemWorkerThread( QObject *parent )
tDebug() << Q_FUNC_INFO; tDebug() << Q_FUNC_INFO;
} }
InfoSystemWorkerThread::~InfoSystemWorkerThread() InfoSystemWorkerThread::~InfoSystemWorkerThread()
{ {
tDebug() << Q_FUNC_INFO; tDebug() << Q_FUNC_INFO;
} }
void void
InfoSystemWorkerThread::InfoSystemWorkerThread::run() InfoSystemWorkerThread::InfoSystemWorkerThread::run()
{ {
@@ -393,6 +397,7 @@ InfoSystemWorkerThread::InfoSystemWorkerThread::run()
delete m_worker.data(); delete m_worker.data();
} }
InfoSystemWorker* InfoSystemWorker*
InfoSystemWorkerThread::worker() const InfoSystemWorkerThread::worker() const
{ {
@@ -401,7 +406,6 @@ InfoSystemWorkerThread::worker() const
return m_worker.data(); return m_worker.data();
} }
} //namespace InfoSystem } //namespace InfoSystem
} //namespace Tomahawk } //namespace Tomahawk

View File

@@ -214,6 +214,7 @@ signals:
void info( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output ); void info( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
void finished( QString target ); void finished( QString target );
void finished( QString target, Tomahawk::InfoSystem::InfoType type ); void finished( QString target, Tomahawk::InfoSystem::InfoType type );
void ready();
void updatedSupportedGetTypes( Tomahawk::InfoSystem::InfoTypeSet supportedTypes ); void updatedSupportedGetTypes( Tomahawk::InfoSystem::InfoTypeSet supportedTypes );
void updatedSupportedPushTypes( Tomahawk::InfoSystem::InfoTypeSet supportedTypes ); void updatedSupportedPushTypes( Tomahawk::InfoSystem::InfoTypeSet supportedTypes );

View File

@@ -43,6 +43,7 @@ namespace InfoSystem
InfoSystemWorker::InfoSystemWorker() InfoSystemWorker::InfoSystemWorker()
: QObject() : QObject()
, m_cache( 0 )
{ {
tDebug() << Q_FUNC_INFO; tDebug() << Q_FUNC_INFO;