don't try to load dataengines with and empty name

This commit is contained in:
Marco Martin 2014-04-02 11:12:11 +02:00
parent a08a3934f5
commit 857b0b8069
2 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,10 @@ void DataSource::setupData()
qDeleteAll(m_services);
m_services.clear();
if (m_engine.isEmpty()) {
return;
}
m_dataEngineConsumer = new Plasma::DataEngineConsumer();
Plasma::DataEngine *engine = dataEngine(m_engine);
if (!engine) {

View File

@ -121,6 +121,10 @@ Plasma::DataEngine *DataEngineManager::engine(const QString &name) const
Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name)
{
if (name.isEmpty()) {
qDebug() << "Asked an engine with empty name";
return d->nullEngine();
}
Plasma::DataEngine::Dict::const_iterator it = d->engines.constFind(name);
if (it != d->engines.constEnd()) {
@ -131,6 +135,7 @@ Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name)
DataEngine *engine = PluginLoader::self()->loadDataEngine(name);
if (!engine) {
qDebug() << "Can't find a dataengine named" << name;
// Try installing the engine. However, it's too late for this request.
ComponentInstaller::self()->installMissingComponent("dataengine", name);