From 21dbf0410face6ab5fd625d51f648561c44a6d0e Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 21 Mar 2022 18:03:45 +0100 Subject: [PATCH] kcm: Fix showing plugins' configuration We were using the plugin infrastructure to tell the name of the plugin we were configuring. Since this doesn't make any sense, just let the kcms themselves define where they want their settings to be. This fixes a regression from when we ported away from using KService to list them. e365e1b35c397e0017803f2edd4b606b5a298ced --- kcmplugin/kdeconnectpluginkcm.cpp | 9 ++++----- plugins/findthisdevice/findthisdevice_config.cpp | 2 +- plugins/pausemusic/pausemusic_config.cpp | 2 +- plugins/runcommand/runcommand_config.cpp | 2 +- plugins/sendnotifications/sendnotifications_config.cpp | 2 +- plugins/share/share_config.cpp | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/kcmplugin/kdeconnectpluginkcm.cpp b/kcmplugin/kdeconnectpluginkcm.cpp index 2777370e8..aa18a23be 100644 --- a/kcmplugin/kdeconnectpluginkcm.cpp +++ b/kcmplugin/kdeconnectpluginkcm.cpp @@ -13,18 +13,17 @@ struct KdeConnectPluginKcmPrivate { QString m_deviceId; QString m_pluginName; - KdeConnectPluginConfig* m_config; + KdeConnectPluginConfig* m_config = nullptr; }; -KdeConnectPluginKcm::KdeConnectPluginKcm(QWidget* parent, const QVariantList& args, const QString& componentName) +KdeConnectPluginKcm::KdeConnectPluginKcm(QWidget* parent, const QVariantList& args, const QString& pluginName) : KCModule(parent, args) , d(new KdeConnectPluginKcmPrivate()) { - d->m_deviceId = args.at(0).toString(); - //The parent of the config should be the plugin itself - d->m_pluginName = KService::serviceByDesktopName(componentName).constData()->property(QStringLiteral("X-KDE-ParentComponents")).toString(); + d->m_pluginName = pluginName; + //The parent of the config should be the plugin itself d->m_config = new KdeConnectPluginConfig(d->m_deviceId, d->m_pluginName); } diff --git a/plugins/findthisdevice/findthisdevice_config.cpp b/plugins/findthisdevice/findthisdevice_config.cpp index 7a24384b5..d9a77a6b9 100644 --- a/plugins/findthisdevice/findthisdevice_config.cpp +++ b/plugins/findthisdevice/findthisdevice_config.cpp @@ -20,7 +20,7 @@ K_PLUGIN_FACTORY(FindThisDeviceConfigFactory, registerPluginsetupUi(this); diff --git a/plugins/pausemusic/pausemusic_config.cpp b/plugins/pausemusic/pausemusic_config.cpp index 9a4fd45fd..01fd2f89d 100644 --- a/plugins/pausemusic/pausemusic_config.cpp +++ b/plugins/pausemusic/pausemusic_config.cpp @@ -12,7 +12,7 @@ K_PLUGIN_FACTORY(PauseMusicConfigFactory, registerPlugin();) PauseMusicConfig::PauseMusicConfig(QWidget* parent, const QVariantList& args) - : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_pausemusic_config")) + : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_pausemusic")) , m_ui(new Ui::PauseMusicConfigUi()) { m_ui->setupUi(this); diff --git a/plugins/runcommand/runcommand_config.cpp b/plugins/runcommand/runcommand_config.cpp index 435d5d6ac..e0e4775e6 100644 --- a/plugins/runcommand/runcommand_config.cpp +++ b/plugins/runcommand/runcommand_config.cpp @@ -26,7 +26,7 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();) RunCommandConfig::RunCommandConfig(QWidget* parent, const QVariantList& args) - : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_runcommand_config")) + : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_runcommand")) { // The qdbus executable name is different on some systems QString qdbusExe = QStringLiteral("qdbus-qt5"); diff --git a/plugins/sendnotifications/sendnotifications_config.cpp b/plugins/sendnotifications/sendnotifications_config.cpp index 4c9ab81fa..4d95f118b 100644 --- a/plugins/sendnotifications/sendnotifications_config.cpp +++ b/plugins/sendnotifications/sendnotifications_config.cpp @@ -14,7 +14,7 @@ K_PLUGIN_FACTORY(SendNotificationsConfigFactory, registerPlugin();) SendNotificationsConfig::SendNotificationsConfig(QWidget* parent, const QVariantList& args) - : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_sendnotifications_config")) + : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_sendnotifications")) , m_ui(new Ui::SendNotificationsConfigUi()) , appModel(new NotifyingApplicationModel) { diff --git a/plugins/share/share_config.cpp b/plugins/share/share_config.cpp index 06af1492f..c455399da 100644 --- a/plugins/share/share_config.cpp +++ b/plugins/share/share_config.cpp @@ -15,7 +15,7 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();) ShareConfig::ShareConfig(QWidget* parent, const QVariantList& args) - : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_share_config")) + : KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_share")) , m_ui(new Ui::ShareConfigUi()) { m_ui->setupUi(this);