Add missing NOTIFY to properties

This commit is contained in:
Albert Vaca Cintora 2023-07-20 19:24:41 +02:00
parent 4fa2e93246
commit dd4831f823
7 changed files with 14 additions and 3 deletions

View file

@ -140,6 +140,8 @@ void KdeConnectPluginConfig::setDeviceId(const QString &deviceId)
if (!m_deviceId.isEmpty() && !m_pluginName.isEmpty()) { if (!m_deviceId.isEmpty() && !m_pluginName.isEmpty()) {
loadConfig(); loadConfig();
} }
Q_EMIT deviceIdChanged(deviceId);
} }
QString KdeConnectPluginConfig::deviceId() QString KdeConnectPluginConfig::deviceId()

View file

@ -21,7 +21,7 @@ class KDECONNECTCORE_EXPORT KdeConnectPluginConfig : public QObject
{ {
Q_OBJECT 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) Q_PROPERTY(QString pluginName READ pluginName WRITE setPluginName NOTIFY configChanged)
public: public:
@ -61,6 +61,7 @@ private Q_SLOTS:
Q_SIGNALS: Q_SIGNALS:
void configChanged(); void configChanged();
void deviceIdChanged(const QString &value);
private: private:
void loadConfig(); void loadConfig();

View file

@ -132,6 +132,8 @@ void DevicesModel::setDisplayFilter(int flags)
m_displayFilter = (StatusFilterFlag)flags; m_displayFilter = (StatusFilterFlag)flags;
refreshDeviceList(); refreshDeviceList();
Q_EMIT displayFilterChanged(flags);
} }
void DevicesModel::refreshDeviceList() void DevicesModel::refreshDeviceList()

View file

@ -20,7 +20,7 @@ class DeviceDbusInterface;
class KDECONNECTINTERFACES_EXPORT DevicesModel : public QAbstractListModel class KDECONNECTINTERFACES_EXPORT DevicesModel : public QAbstractListModel
{ {
Q_OBJECT 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) Q_PROPERTY(int count READ rowCount NOTIFY rowsChanged)
public: public:
@ -68,6 +68,7 @@ private Q_SLOTS:
Q_SIGNALS: Q_SIGNALS:
void rowsChanged(); void rowsChanged();
void displayFilterChanged(int value);
private: private:
void clearDevices(); void clearDevices();

View file

@ -34,6 +34,8 @@ void PluginModel::setDeviceId(const QString &deviceId)
m_deviceId = deviceId; m_deviceId = deviceId;
DeviceDbusInterface *device = new DeviceDbusInterface(m_deviceId); DeviceDbusInterface *device = new DeviceDbusInterface(m_deviceId);
m_config = KSharedConfig::openConfig(device->pluginsConfigFile()); m_config = KSharedConfig::openConfig(device->pluginsConfigFile());
Q_EMIT deviceIdChanged(deviceId);
} }
QVariant PluginModel::data(const QModelIndex &index, int role) const QVariant PluginModel::data(const QModelIndex &index, int role) const

View file

@ -81,6 +81,8 @@ void ConversationModel::setDeviceId(const QString &deviceId)
// Clear any previous data on device change // Clear any previous data on device change
m_thumbnailsProvider->clear(); m_thumbnailsProvider->clear();
Q_EMIT deviceIdChanged(deviceId);
} }
void ConversationModel::setAddressList(const QList<ConversationAddress> &addressList) void ConversationModel::setAddressList(const QList<ConversationAddress> &addressList)

View file

@ -21,7 +21,7 @@ class ConversationModel : public QStandardItemModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(qint64 threadId READ threadId WRITE setThreadId) 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<ConversationAddress> addressList READ addressList WRITE setAddressList) Q_PROPERTY(QList<ConversationAddress> addressList READ addressList WRITE setAddressList)
public: public:
@ -64,6 +64,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void loadingFinished(); void loadingFinished();
void filePathReceived(QString filePath, QString fileName); void filePathReceived(QString filePath, QString fileName);
void deviceIdChanged(const QString &value);
private Q_SLOTS: private Q_SLOTS:
void handleConversationUpdate(const QDBusVariant &message); void handleConversationUpdate(const QDBusVariant &message);