Commit 3c82c358 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Add a generic "something changed" signal

parent 2b502eb0
......@@ -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<QString>(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
......
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment