Commit 0312a19b authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

De-duplicate KCMs based on plugin id of converted KPluginMetaData object

In case of KIO, the KCM metadata files need to be kept for compatibility, but they
reference the KCM in a proper Plasma namespace. However we need to set the plugin id explicitly
in order for the desktop file to be found then the KCM should be pinned.
The explicit value differs from the one we would derive from the library name.
This means that de-duplicating based on the library name no longer works.
parent 16c1ee0c
......@@ -88,10 +88,13 @@ inline QList<KPluginMetaData> findKCMsMetaData(MetaDataSource source, bool useSy
for (const auto &s : qAsConst(services)) {
if (!s->noDisplay() && !s->exec().isEmpty() && !uniquePluginIds.contains(s->library()) && KAuthorized::authorizeControlModule(s->menuId())) {
if (!s->noDisplay() && !s->exec().isEmpty() && KAuthorized::authorizeControlModule(s->menuId())) {
QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kservices5/") + s->entryPath());
modules << KPluginMetaData::fromDesktopFile(path);
uniquePluginIds << s->library();
const KPluginMetaData data = KPluginMetaData::fromDesktopFile(path);
if (!uniquePluginIds.contains(data.pluginId())) {
modules << data;
uniquePluginIds << data.pluginId();
std::stable_sort(modules.begin(), modules.end(), [](const KPluginMetaData &m1, const KPluginMetaData &m2) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment