return the null engine when a QString() engine() is requested

svn path=/trunk/KDE/kdelibs/; revision=1051211
This commit is contained in:
Aaron J. Seigo 2009-11-19 00:17:29 +00:00
parent 62f15dae7a
commit 47993d39b3

View File

@ -95,6 +95,10 @@ DataEngineManager::~DataEngineManager()
Plasma::DataEngine *DataEngineManager::engine(const QString &name) const Plasma::DataEngine *DataEngineManager::engine(const QString &name) const
{ {
if (name.isEmpty()) {
return d->nullEngine();
}
Plasma::DataEngine::Dict::const_iterator it = d->engines.constFind(name); Plasma::DataEngine::Dict::const_iterator it = d->engines.constFind(name);
if (it != d->engines.constEnd()) { if (it != d->engines.constEnd()) {
// ref and return the engine // ref and return the engine