Fix KF5 build

This commit is contained in:
Alexander Lohnau 2023-04-28 14:42:21 +02:00
parent 44be5caf5b
commit 4993daa973
5 changed files with 19 additions and 3 deletions

View file

@ -122,7 +122,7 @@ QSet<QString> PluginLoader::pluginsForCapabilities(const QSet<QString> &incoming
if (!supportedDeviceTypes.isEmpty()) {
if (!supportedDeviceTypes.contains(myDeviceType)) {
qCDebug(KDECONNECT_CORE) << "Not loading plugin" << service.pluginId() << "because this device of type" << myDeviceType
<< "is not supported. Supports:" << supportedDeviceTypes.toList().join(QStringLiteral(", "));
<< "is not supported. Supports:" << supportedDeviceTypes.join(QStringLiteral(", "));
continue;
}
}

View file

@ -28,7 +28,7 @@ static QString createId()
}
KdeConnectKcm::KdeConnectKcm(QObject *parent, const QVariantList &args)
: KCModule(parent)
: KCModule(qobject_cast<QWidget *>(parent))
, kcmUi(new Ui::KdeConnectKcmUi())
, daemon(new DaemonDbusInterface(this))
, devicesModel(new DevicesModel(this))

View file

@ -9,6 +9,7 @@
#include <KCModule>
#include <QStandardItemModel>
#include <kconfigwidgets_version.h>
class QModelIndex;
class DeviceDbusInterface;
@ -28,6 +29,13 @@ public:
KdeConnectKcm(QObject *parent, const QVariantList &);
~KdeConnectKcm() override;
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
QWidget *widget()
{
return this;
}
#endif
private:
void save() override;

View file

@ -16,7 +16,7 @@ struct KdeConnectPluginKcmPrivate {
};
KdeConnectPluginKcm::KdeConnectPluginKcm(QObject *parent, const QVariantList &args, const QString &pluginName)
: KCModule(parent, args)
: KCModule(qobject_cast<QWidget *>(parent), args)
, d(new KdeConnectPluginKcmPrivate())
{
d->m_deviceId = args.at(0).toString();

View file

@ -8,6 +8,7 @@
#define KDECONNECTPLUGINKCM_H
#include <KCModule>
#include <kconfigwidgets_version.h>
#include "core/kdeconnectpluginconfig.h"
#include "kdeconnectpluginkcm_export.h"
@ -36,6 +37,13 @@ public:
*/
KdeConnectPluginConfig *config() const;
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
QWidget *widget()
{
return this;
}
#endif
private:
QScopedPointer<KdeConnectPluginKcmPrivate> d;
};