don't cache empty sources

This commit is contained in:
Marco Martin 2011-09-15 21:05:06 +02:00
parent bcb05dfc9b
commit e18e08c2f1

View File

@ -185,7 +185,11 @@ QStringList DataSource::keysForSource(const QString &source) const
Plasma::Service *DataSource::serviceForSource(const QString &source)
{
if (!m_services.contains(source)) {
m_services[source] = m_dataEngine->serviceForSource(source);
Plasma::Service *service = m_dataEngine->serviceForSource(source);
if (!service) {
return 0;
}
m_services[source] = service;
}
return m_services.value(source);