diff --git a/core/daemon.cpp b/core/daemon.cpp index 1f5d76c60..de98076c0 100644 --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -125,6 +125,7 @@ void Daemon::removeDevice(Device* device) d->m_devices.remove(device->id()); device->deleteLater(); Q_EMIT deviceRemoved(device->id()); + Q_EMIT deviceListChanged(); } void Daemon::cleanDevices() @@ -194,6 +195,7 @@ void Daemon::onNewDeviceLink(const NetworkPacket& identityPacket, DeviceLink* dl device->addLink(identityPacket, dl); if (!wasReachable) { Q_EMIT deviceVisibilityChanged(id, true); + Q_EMIT deviceListChanged(); } } else { qCDebug(KDECONNECT_CORE) << "It is a new device" << identityPacket.get(QStringLiteral("deviceName")); @@ -219,6 +221,7 @@ void Daemon::onDeviceStatusChanged() removeDevice(device); } else { Q_EMIT deviceVisibilityChanged(device->id(), device->isReachable()); + Q_EMIT deviceListChanged(); } } @@ -277,6 +280,7 @@ void Daemon::addDevice(Device* device) d->m_devices[id] = device; Q_EMIT deviceAdded(id); + Q_EMIT deviceListChanged(); } QStringList Daemon::pairingRequests() const diff --git a/core/daemon.h b/core/daemon.h index aa147fadb..41995701e 100644 --- a/core/daemon.h +++ b/core/daemon.h @@ -81,6 +81,7 @@ Q_SIGNALS: Q_SCRIPTABLE void deviceAdded(const QString& id); Q_SCRIPTABLE void deviceRemoved(const QString& id); //Note that paired devices will never be removed Q_SCRIPTABLE void deviceVisibilityChanged(const QString& id, bool isVisible); + Q_SCRIPTABLE void deviceListChanged(); //Emitted when any of deviceAdded, deviceRemoved or deviceVisibilityChanged is emitted Q_SCRIPTABLE void announcedNameChanged(const QString& announcedName); Q_SCRIPTABLE void pairingRequestsChanged();