Add missing NOTIFY to properties

This commit is contained in:
Albert Vaca Cintora 2023-07-20 19:24:41 +02:00
parent 6c1b81a384
commit c1a452c111
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()) {
loadConfig();
}
Q_EMIT deviceIdChanged(deviceId);
}
QString KdeConnectPluginConfig::deviceId()

View file

@ -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();

View file

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

View file

@ -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();

View file

@ -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

View file

@ -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<ConversationAddress> &addressList)

View file

@ -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<ConversationAddress> 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);