Print useful warning when we can not get valid KPluginInfo

We can not generate proper PluginInfo most likely because metadata was
not valid, printing metadata itself will not be useful and will result
in printing message like,

Could not load plugin info for plugin : "" skipping plugin

Which is 0% useful.
This commit is contained in:
Bhushan Shah 2015-07-16 19:13:44 +05:30
parent 2b31836bdc
commit 084d527638

View File

@ -574,7 +574,7 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS
for (auto md : KPackage::PackageLoader::self()->findPackages("Plasma/Applet", QString(), filter)) {
auto pi = KPluginInfo(KService::serviceByStorageId(md.metaDataFileName()));
if (!pi.isValid()) {
qWarning() << "Could not load plugin info:" << md.metaDataFileName() << "skipping plugin";
qWarning() << "Could not load plugin info for plugin :" << md.pluginId() << "skipping plugin";
continue;
}
list << pi;
@ -600,7 +600,7 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS
for (auto md : KPackage::PackageLoader::self()->findPackages("Plasma/Applet", QString(), filter)) {
auto pi = KPluginInfo(KService::serviceByStorageId(md.metaDataFileName()));
if (!pi.isValid()) {
qWarning() << "Could not load plugin info:" << md.metaDataFileName() << "skipping plugin";
qWarning() << "Could not load plugin info for plugin :" << md.pluginId() << "skipping plugin";
continue;
}
list << pi;