2015-03-14 04:19:39 +00:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
2015-03-14 04:19:39 +00:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2015-03-14 04:19:39 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "kdeconnectpluginkcm.h"
|
|
|
|
|
|
|
|
#include <KAboutData>
|
|
|
|
#include <KService>
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
struct KdeConnectPluginKcmPrivate {
|
2017-09-03 20:39:44 +01:00
|
|
|
QString m_deviceId;
|
|
|
|
QString m_pluginName;
|
2022-09-10 22:23:52 +01:00
|
|
|
KdeConnectPluginConfig *m_config = nullptr;
|
2015-03-14 04:19:39 +00:00
|
|
|
};
|
|
|
|
|
2023-04-17 18:10:08 +01:00
|
|
|
KdeConnectPluginKcm::KdeConnectPluginKcm(QObject *parent, const QVariantList &args, const QString &pluginName)
|
|
|
|
#if QT_VERSION_MAJOR < 6
|
|
|
|
: KCModule(qobject_cast<QWidget *>(parent), args)
|
|
|
|
#else
|
|
|
|
: KCModule(parent)
|
|
|
|
#endif
|
2015-03-14 04:19:39 +00:00
|
|
|
, d(new KdeConnectPluginKcmPrivate())
|
|
|
|
{
|
2017-09-03 20:39:44 +01:00
|
|
|
d->m_deviceId = args.at(0).toString();
|
2022-03-21 17:03:45 +00:00
|
|
|
d->m_pluginName = pluginName;
|
2015-03-14 04:19:39 +00:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
// The parent of the config should be the plugin itself
|
2017-09-03 20:39:44 +01:00
|
|
|
d->m_config = new KdeConnectPluginConfig(d->m_deviceId, d->m_pluginName);
|
2015-03-14 04:19:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
KdeConnectPluginKcm::~KdeConnectPluginKcm()
|
|
|
|
{
|
2017-09-03 20:39:44 +01:00
|
|
|
delete d->m_config;
|
2015-03-14 04:19:39 +00:00
|
|
|
}
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
KdeConnectPluginConfig *KdeConnectPluginKcm::config() const
|
2015-03-14 04:19:39 +00:00
|
|
|
{
|
2017-09-03 20:39:44 +01:00
|
|
|
return d->m_config;
|
2015-03-14 04:19:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString KdeConnectPluginKcm::deviceId() const
|
|
|
|
{
|
2017-09-03 20:39:44 +01:00
|
|
|
return d->m_deviceId;
|
2015-03-14 04:19:39 +00:00
|
|
|
}
|