don't crash when serviceForSource is called "too early" on a remote data engine
svn path=/trunk/KDE/kdelibs/; revision=1037790
This commit is contained in:
parent
631f1052b1
commit
9500388d8d
@ -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<QString, RemoteService *> 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*)),
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user