From 0155b5e2eb97a2a3ae20b9a3a3313a9690cdefe1 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 19 Aug 2014 06:44:29 +0200 Subject: [PATCH] * Queue infosystem requests until its ready on startup. --- src/libtomahawk/infosystem/InfoSystemWorker.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/infosystem/InfoSystemWorker.cpp b/src/libtomahawk/infosystem/InfoSystemWorker.cpp index e132be95d..f80ff68ae 100644 --- a/src/libtomahawk/infosystem/InfoSystemWorker.cpp +++ b/src/libtomahawk/infosystem/InfoSystemWorker.cpp @@ -30,6 +30,7 @@ #include "utils/TomahawkUtils.h" #include "utils/Logger.h" #include "utils/PluginLoader.h" +#include "utils/Closure.h" #include "Source.h" #include @@ -225,8 +226,15 @@ InfoSystemWorker::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) QList< InfoPluginPtr > providers = determineOrderedMatches( requestData.type ); if ( providers.isEmpty() ) { - emit info( requestData, QVariant() ); - checkFinished( requestData ); + // We're not ready yet, retry this request in a bit + QTimer* timer = new QTimer(); + timer->setInterval( 500 ); + timer->setSingleShot( true ); + NewClosure( timer, SIGNAL( timeout() ), this, SLOT( getInfo( Tomahawk::InfoSystem::InfoRequestData ) ), requestData ); + timer->start(); + +/* emit info( requestData, QVariant() ); + checkFinished( requestData );*/ return; }