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. e365e1b35c
This commit is contained in:
Aleix Pol 2022-03-21 18:03:45 +01:00
parent a09825c498
commit 21dbf0410f
6 changed files with 9 additions and 10 deletions

View file

@ -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);
}

View file

@ -20,7 +20,7 @@ K_PLUGIN_FACTORY(FindThisDeviceConfigFactory, registerPlugin<FindThisDeviceConfi
FindThisDeviceConfig::FindThisDeviceConfig(QWidget* parent, const QVariantList& args)
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_findthisdevice_config"))
: KdeConnectPluginKcm(parent, args, QStringLiteral("kdeconnect_findthisdevice"))
, m_ui(new Ui::FindThisDeviceConfigUi())
{
m_ui->setupUi(this);

View file

@ -12,7 +12,7 @@
K_PLUGIN_FACTORY(PauseMusicConfigFactory, registerPlugin<PauseMusicConfig>();)
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);

View file

@ -26,7 +26,7 @@ K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<RunCommandConfig>();)
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");

View file

@ -14,7 +14,7 @@
K_PLUGIN_FACTORY(SendNotificationsConfigFactory, registerPlugin<SendNotificationsConfig>();)
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)
{

View file

@ -15,7 +15,7 @@
K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin<ShareConfig>();)
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);