Changeset View
Changeset View
Standalone View
Standalone View
src/core/agentmanager.cpp
Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Line(s) | 377 | if (!AgentManagerPrivate::mSelf) { | |||
---|---|---|---|---|---|
378 | AgentManagerPrivate::mSelf = new AgentManager(); | 378 | AgentManagerPrivate::mSelf = new AgentManager(); | ||
379 | } | 379 | } | ||
380 | 380 | | |||
381 | return AgentManagerPrivate::mSelf; | 381 | return AgentManagerPrivate::mSelf; | ||
382 | } | 382 | } | ||
383 | 383 | | |||
384 | AgentType::List AgentManager::types() const | 384 | AgentType::List AgentManager::types() const | ||
385 | { | 385 | { | ||
386 | // Maybe the Control process is up and ready but we haven't been to the event loop yet so serviceOwnerChanged wasn't called yet. | ||||
387 | // In that case make sure to do it here, to avoid going into Broken state. | ||||
388 | if (d->mTypes.isEmpty()) { | ||||
389 | d->readAgentTypes(); | ||||
390 | } | ||||
386 | return Akonadi::valuesToVector(d->mTypes); | 391 | return Akonadi::valuesToVector(d->mTypes); | ||
387 | } | 392 | } | ||
388 | 393 | | |||
389 | AgentType AgentManager::type(const QString &identifier) const | 394 | AgentType AgentManager::type(const QString &identifier) const | ||
390 | { | 395 | { | ||
391 | return d->mTypes.value(identifier); | 396 | return d->mTypes.value(identifier); | ||
392 | } | 397 | } | ||
393 | 398 | | |||
Show All 28 Lines |