From c1a452c1110bad150682444207e200da5f1210a3 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 20 Jul 2023 19:24:41 +0200 Subject: [PATCH] Add missing NOTIFY to properties --- core/kdeconnectpluginconfig.cpp | 2 ++ core/kdeconnectpluginconfig.h | 3 ++- interfaces/devicesmodel.cpp | 2 ++ interfaces/devicesmodel.h | 3 ++- interfaces/pluginmodel.cpp | 2 ++ smsapp/conversationmodel.cpp | 2 ++ smsapp/conversationmodel.h | 3 ++- 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/core/kdeconnectpluginconfig.cpp b/core/kdeconnectpluginconfig.cpp index 047b038f9..c8dbc71e8 100644 --- a/core/kdeconnectpluginconfig.cpp +++ b/core/kdeconnectpluginconfig.cpp @@ -140,6 +140,8 @@ void KdeConnectPluginConfig::setDeviceId(const QString &deviceId) if (!m_deviceId.isEmpty() && !m_pluginName.isEmpty()) { loadConfig(); } + + Q_EMIT deviceIdChanged(deviceId); } QString KdeConnectPluginConfig::deviceId() diff --git a/core/kdeconnectpluginconfig.h b/core/kdeconnectpluginconfig.h index db9c816a2..7bd59443e 100644 --- a/core/kdeconnectpluginconfig.h +++ b/core/kdeconnectpluginconfig.h @@ -21,7 +21,7 @@ class KDECONNECTCORE_EXPORT KdeConnectPluginConfig : public QObject { Q_OBJECT - Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId NOTIFY configChanged) + Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId NOTIFY deviceIdChanged) Q_PROPERTY(QString pluginName READ pluginName WRITE setPluginName NOTIFY configChanged) public: @@ -61,6 +61,7 @@ private Q_SLOTS: Q_SIGNALS: void configChanged(); + void deviceIdChanged(const QString &value); private: void loadConfig(); diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp index 9763e2152..d8502b4b6 100644 --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -139,6 +139,8 @@ void DevicesModel::setDisplayFilter(int flags) m_displayFilter = (StatusFilterFlag)flags; refreshDeviceList(); + + Q_EMIT displayFilterChanged(flags); } void DevicesModel::refreshDeviceList() diff --git a/interfaces/devicesmodel.h b/interfaces/devicesmodel.h index 478411f0d..e8c08af56 100644 --- a/interfaces/devicesmodel.h +++ b/interfaces/devicesmodel.h @@ -20,7 +20,7 @@ class DeviceDbusInterface; class KDECONNECTINTERFACES_EXPORT DevicesModel : public QAbstractListModel { Q_OBJECT - Q_PROPERTY(int displayFilter READ displayFilter WRITE setDisplayFilter) + Q_PROPERTY(int displayFilter READ displayFilter WRITE setDisplayFilter NOTIFY displayFilterChanged) Q_PROPERTY(int count READ rowCount NOTIFY rowsChanged) public: @@ -68,6 +68,7 @@ private Q_SLOTS: Q_SIGNALS: void rowsChanged(); + void displayFilterChanged(int value); private: void clearDevices(); diff --git a/interfaces/pluginmodel.cpp b/interfaces/pluginmodel.cpp index 73dc7d8fb..bcdef0f12 100644 --- a/interfaces/pluginmodel.cpp +++ b/interfaces/pluginmodel.cpp @@ -41,6 +41,8 @@ void PluginModel::setDeviceId(const QString &deviceId) m_deviceId = deviceId; DeviceDbusInterface *device = new DeviceDbusInterface(m_deviceId); m_config = KSharedConfig::openConfig(device->pluginsConfigFile()); + + Q_EMIT deviceIdChanged(deviceId); } QVariant PluginModel::data(const QModelIndex &index, int role) const diff --git a/smsapp/conversationmodel.cpp b/smsapp/conversationmodel.cpp index 2a962d1e0..dedd6f5c4 100644 --- a/smsapp/conversationmodel.cpp +++ b/smsapp/conversationmodel.cpp @@ -81,6 +81,8 @@ void ConversationModel::setDeviceId(const QString &deviceId) // Clear any previous data on device change m_thumbnailsProvider->clear(); + + Q_EMIT deviceIdChanged(deviceId); } void ConversationModel::setAddressList(const QList &addressList) diff --git a/smsapp/conversationmodel.h b/smsapp/conversationmodel.h index e35942653..399e3e56d 100644 --- a/smsapp/conversationmodel.h +++ b/smsapp/conversationmodel.h @@ -21,7 +21,7 @@ class ConversationModel : public QStandardItemModel { Q_OBJECT Q_PROPERTY(qint64 threadId READ threadId WRITE setThreadId) - Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId) + Q_PROPERTY(QString deviceId READ deviceId WRITE setDeviceId NOTIFY deviceIdChanged) Q_PROPERTY(QList addressList READ addressList WRITE setAddressList) public: @@ -64,6 +64,7 @@ public: Q_SIGNALS: void loadingFinished(); void filePathReceived(QString filePath, QString fileName); + void deviceIdChanged(const QString &value); private Q_SLOTS: void handleConversationUpdate(const QDBusVariant &message);