manager: clear known_path when KnownNetwork object is removed

Forgetting a saved network removes the KnownNetwork D-Bus object, but the
matching Network.KnownNetwork change arrives only as a property
invalidation, which our changed-only handler drops. As a result
n->known_path stayed stale and the ★ marker and Forget (✕) button kept
showing until the next full repopulate (radio off/on).

Add an IWD_IFACE_KNOWN_NETWORK branch to _on_iface_removed that clears
known_path on any network pointing at the removed object, then notifies,
so the markers vanish immediately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-06-29 14:55:11 +09:00
commit 0f34fe39e0

View file

@ -245,6 +245,20 @@ _on_iface_removed(void *data, const char *path, const char *iface)
{ {
eina_hash_del(m->networks, path, NULL); eina_hash_del(m->networks, path, NULL);
} }
else if (!strcmp(iface, IWD_IFACE_KNOWN_NETWORK))
{
/* A saved network was forgotten: iwd removes the KnownNetwork object
* but the matching Network.KnownNetwork change arrives only as an
* invalidation, which our changed-only property handler drops. Clear
* the back-reference here so the marker and Forget () button vanish
* immediately instead of lingering until the next full repopulate. */
Eina_Iterator *it = eina_hash_iterator_data_new(m->networks);
Iwd_Network *n;
EINA_ITERATOR_FOREACH(it, n)
if (n->known_path && !strcmp(n->known_path, path))
{ free(n->known_path); n->known_path = NULL; }
eina_iterator_free(it);
}
else if (!strcmp(iface, IWD_IFACE_ADAPTER)) else if (!strcmp(iface, IWD_IFACE_ADAPTER))
{ {
eina_hash_del(m->adapters, path, NULL); eina_hash_del(m->adapters, path, NULL);