diff --git a/private/remotedataengine.cpp b/private/remotedataengine.cpp index ef9515311..dd9414982 100644 --- a/private/remotedataengine.cpp +++ b/private/remotedataengine.cpp @@ -69,10 +69,17 @@ Plasma::Service* RemoteDataEngine::serviceForSource(const QString& source) } else { RemoteService *service = new RemoteService(this); m_serviceForSource[source] = service; + initRemoteService(source, service); + return service; + } +} + +void RemoteDataEngine::initRemoteService(const QString &source, RemoteService *service) +{ + if (m_service) { KConfigGroup op = m_service->operationDescription("ServiceForSource"); op.writeEntry("SourceName", source); m_service->startOperationCall(op); - return service; } } @@ -83,6 +90,13 @@ void RemoteDataEngine::init() void RemoteDataEngine::serviceReady(Plasma::Service *service) { m_service = service; + + QMapIterator it(m_serviceForSource); + while (it.hasNext()) { + it.next(); + initRemoteService(it.key(), it.value()); + } + KConfigGroup op = m_service->operationDescription("GetSourceNames"); m_service->startOperationCall(op); connect(m_service, SIGNAL(finished(Plasma::ServiceJob*)), diff --git a/private/remotedataengine.h b/private/remotedataengine.h index 96adab678..06329624f 100644 --- a/private/remotedataengine.h +++ b/private/remotedataengine.h @@ -49,6 +49,7 @@ private Q_SLOTS: void serviceReady(Plasma::Service *service); void remoteCallFinished(Plasma::ServiceJob *job); void updateSources(); + void initRemoteService(const QString &source, RemoteService *service); private: Service *m_service;