| Summary: | KPluginLoader::KPluginLoader() - misleading? error message | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kcmutils | Reporter: | Elias Probst <mail> |
| Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | davispuh, kdelibs-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Elias Probst
2015-06-06 22:24:38 UTC
I've same issue on Arch Linux with Qt 5.5 and all KF5 latest from git master branch (even plasma-desktop, etc.). It happens for all kcms, but seems like everything is working, only this
systemsettings5[6563]: Error loading plugin "kcm_lookandfeel" "The shared library was not found."
Plugin search paths are ("/usr/lib/qt/plugins", "/usr/bin")
The environment variable QT_PLUGIN_PATH might be not correctly set
QT_PLUGIN_PATH is empty and kcm_lookandfeel is located at /usr/lib/qt/plugins/kcms/
I've reproduced the message but I think it's better reported against frameworks-kcmutils. I'm not real eager to disable a global warning to make KCMs less noisy, and the following patch to kcmutils allows it to load new KCMs without a warning (by using KPluginLoader::findPlugin to check which name is most appropriate).
However I'm not entirely sure there's no other issues so I don't want to commit myself.
diff --git a/src/kcmoduleloader.cpp b/src/kcmoduleloader.cpp
index 4090ac1..533e892 100644
--- a/src/kcmoduleloader.cpp
+++ b/src/kcmoduleloader.cpp
@@ -89,22 +89,22 @@ KCModule *KCModuleLoader::loadModule(const KCModuleInfo &mod, ErrorReporting rep
foreach (const QString &arg, args) {
args2 << arg;
}
- KCModule *module = mod.service()->createInstance<KCModule>(parent, args2, &error);
- if (module) {
- return module;
+
+ QString pluginName (mod.service()->library());
+ if (KPluginLoader::findPlugin(pluginName).isEmpty()) {
+ pluginName.prepend(QLatin1String("kcms/"));
+ }
+
+ KPluginLoader loader(KPluginLoader::findPlugin(pluginName));
+ KPluginFactory* factory = loader.factory();
+ if (!factory) {
+ qWarning() << "Error loading plugin:" << loader.errorString();
} else {
- KPluginLoader loader(KPluginLoader::findPlugin(QLatin1String("kcms/") + mod.service()->library()));
- KPluginFactory* factory = loader.factory();
- if (!factory) {
- qWarning() << "Error loading plugin:" << loader.errorString();
- } else {
- KQuickAddons::ConfigModule *cm = factory->create<KQuickAddons::ConfigModule >();
- if (!cm) {
- qWarning() << "Error creating object from plugin" << loader.fileName();
- }
- module = new KCModuleQml(cm, parent, args2);
- return module;
+ KQuickAddons::ConfigModule *cm = factory->create<KQuickAddons::ConfigModule >();
+ if (!cm) {
+ qWarning() << "Error creating object from plugin" << loader.fileName();
}
+ return new KCModuleQml(cm, parent, args2);
}
//#ifndef NDEBUG
{
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved. |