Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/private/dataenginemanager.cpp
Show All 22 Lines | |||||
23 | #include <QTextStream> | 23 | #include <QTextStream> | ||
24 | 24 | | |||
25 | #include <QDebug> | 25 | #include <QDebug> | ||
26 | 26 | | |||
27 | #include <qstandardpaths.h> | 27 | #include <qstandardpaths.h> | ||
28 | 28 | | |||
29 | #include "datacontainer.h" | 29 | #include "datacontainer.h" | ||
30 | #include "pluginloader.h" | 30 | #include "pluginloader.h" | ||
31 | #include "private/componentinstaller_p.h" | | |||
32 | #include "private/dataengine_p.h" | 31 | #include "private/dataengine_p.h" | ||
33 | #include "private/datacontainer_p.h" | 32 | #include "private/datacontainer_p.h" | ||
34 | #include "scripting/scriptengine.h" | 33 | #include "scripting/scriptengine.h" | ||
35 | #include "debug_p.h" | 34 | #include "debug_p.h" | ||
36 | 35 | | |||
37 | namespace Plasma | 36 | namespace Plasma | ||
38 | { | 37 | { | ||
39 | 38 | | |||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 127 | if (it != d->engines.constEnd()) { | |||
129 | DataEngine *engine = *it; | 128 | DataEngine *engine = *it; | ||
130 | engine->d->ref(); | 129 | engine->d->ref(); | ||
131 | return engine; | 130 | return engine; | ||
132 | } | 131 | } | ||
133 | 132 | | |||
134 | DataEngine *engine = PluginLoader::self()->loadDataEngine(name); | 133 | DataEngine *engine = PluginLoader::self()->loadDataEngine(name); | ||
135 | if (!engine) { | 134 | if (!engine) { | ||
136 | qCDebug(LOG_PLASMA) << "Can't find a dataengine named" << name; | 135 | qCDebug(LOG_PLASMA) << "Can't find a dataengine named" << name; | ||
137 | // Try installing the engine. However, it's too late for this request. | | |||
138 | ComponentInstaller::self()->installMissingComponent(QStringLiteral("dataengine"), name); | | |||
139 | | ||||
140 | return d->nullEngine(); | 136 | return d->nullEngine(); | ||
141 | } | 137 | } | ||
142 | 138 | | |||
143 | d->engines[name] = engine; | 139 | d->engines[name] = engine; | ||
144 | return engine; | 140 | return engine; | ||
145 | } | 141 | } | ||
146 | 142 | | |||
147 | void DataEngineManager::unloadEngine(const QString &name) | 143 | void DataEngineManager::unloadEngine(const QString &name) | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |