PluginLoader::loadApplet: restore compatibility for misinstalled applets.

Summary:
The notifications applet installs the .so into the toplevel plugins dir,
and my earlier code removal broke the loading of that applet.

Reviewers: lbeltrame, mart

Reviewed By: mart

Differential Revision: https://phabricator.kde.org/D1851
This commit is contained in:
David Faure 2016-06-13 21:54:17 +02:00
parent 15bd197fac
commit 967e81611f

View File

@ -198,6 +198,10 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
return md.pluginId() == pluginName; return md.pluginId() == pluginName;
}; };
QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(PluginLoaderPrivate::s_plasmoidsPluginDir, filter); QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(PluginLoaderPrivate::s_plasmoidsPluginDir, filter);
if (plugins.isEmpty()) {
// COMPAT CODE for applets installed into the toplevel plugins dir by mistake.
plugins = KPluginLoader::findPlugins(QString(), filter);
}
if (!plugins.isEmpty()) { if (!plugins.isEmpty()) {
KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins); KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins);