Fix qml runtime warning when accessing property without NOTIFIY

This commit is contained in:
Albert Vaca Cintora 2023-07-22 19:58:56 +02:00
parent 23f4b848a2
commit 46cac0bf61

View file

@ -54,8 +54,7 @@ Q_SIGNALS:
class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface : public OrgKdeKdeconnectDeviceInterface class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface : public OrgKdeKdeconnectDeviceInterface
{ {
Q_OBJECT Q_OBJECT
// TODO: Workaround because OrgKdeKdeconnectDeviceInterface is not generating // Workaround because qdbusxml2cpp is not generating NOTIFY for properties
// the signals for the properties
Q_PROPERTY(bool isReachable READ isReachable NOTIFY reachableChangedProxy) Q_PROPERTY(bool isReachable READ isReachable NOTIFY reachableChangedProxy)
Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairStateChangedProxy) Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairStateChangedProxy)
Q_PROPERTY(bool isPairRequested READ isPairRequested NOTIFY pairStateChangedProxy) Q_PROPERTY(bool isPairRequested READ isPairRequested NOTIFY pairStateChangedProxy)
@ -148,8 +147,7 @@ public:
class KDECONNECTINTERFACES_EXPORT MprisDbusInterface : public OrgKdeKdeconnectDeviceMprisremoteInterface class KDECONNECTINTERFACES_EXPORT MprisDbusInterface : public OrgKdeKdeconnectDeviceMprisremoteInterface
{ {
Q_OBJECT Q_OBJECT
// TODO: Workaround because qdbusxml2cpp is not generating // Workaround because qdbusxml2cpp is not generating NOTIFY for properties
// the signals for the properties
Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY propertiesChangedProxy) Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY propertiesChangedProxy)
Q_PROPERTY(int length READ length NOTIFY propertiesChangedProxy) Q_PROPERTY(int length READ length NOTIFY propertiesChangedProxy)
Q_PROPERTY(QString title READ title NOTIFY propertiesChangedProxy) Q_PROPERTY(QString title READ title NOTIFY propertiesChangedProxy)
@ -199,6 +197,8 @@ public:
class KDECONNECTINTERFACES_EXPORT RemoteCommandsDbusInterface : public OrgKdeKdeconnectDeviceRemotecommandsInterface class KDECONNECTINTERFACES_EXPORT RemoteCommandsDbusInterface : public OrgKdeKdeconnectDeviceRemotecommandsInterface
{ {
Q_OBJECT Q_OBJECT
// Workaround because qdbusxml2cpp is not generating CONSTANT for properties and qml complains at runtime
Q_PROPERTY(QString deviceId READ deviceId CONSTANT)
public: public:
explicit RemoteCommandsDbusInterface(const QString &deviceId, QObject *parent = nullptr); explicit RemoteCommandsDbusInterface(const QString &deviceId, QObject *parent = nullptr);
~RemoteCommandsDbusInterface() override; ~RemoteCommandsDbusInterface() override;
@ -242,6 +242,8 @@ public:
class KDECONNECTINTERFACES_EXPORT RemoteSystemVolumeDbusInterface : public OrgKdeKdeconnectDeviceRemotesystemvolumeInterface class KDECONNECTINTERFACES_EXPORT RemoteSystemVolumeDbusInterface : public OrgKdeKdeconnectDeviceRemotesystemvolumeInterface
{ {
Q_OBJECT Q_OBJECT
// Workaround because qdbusxml2cpp is not generating CONSTANT for properties and qml complains at runtime
Q_PROPERTY(QString deviceId READ deviceId CONSTANT)
public: public:
explicit RemoteSystemVolumeDbusInterface(const QString &deviceId, QObject *parent = nullptr); explicit RemoteSystemVolumeDbusInterface(const QString &deviceId, QObject *parent = nullptr);
~RemoteSystemVolumeDbusInterface() override = default; ~RemoteSystemVolumeDbusInterface() override = default;