mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-05 10:27:11 +00:00
Emit ::Changed() when devices are added or removed
This allows clients to reget any available updates.
This commit is contained in:
parent
1e59872733
commit
d7022b50e6
@ -62,6 +62,23 @@ typedef struct {
|
||||
FuProvider *provider;
|
||||
} FuDeviceItem;
|
||||
|
||||
/**
|
||||
* fu_main_emit_changed:
|
||||
**/
|
||||
static void
|
||||
fu_main_emit_changed (FuMainPrivate *priv)
|
||||
{
|
||||
/* not yet connected */
|
||||
if (priv->connection == NULL)
|
||||
return;
|
||||
g_dbus_connection_emit_signal (priv->connection,
|
||||
NULL,
|
||||
FWUPD_DBUS_PATH,
|
||||
FWUPD_DBUS_INTERFACE,
|
||||
"Changed",
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* fu_main_emit_property_changed:
|
||||
**/
|
||||
@ -802,6 +819,7 @@ cd_main_provider_device_added_cb (FuProvider *provider,
|
||||
item->device = g_object_ref (device);
|
||||
item->provider = g_object_ref (provider);
|
||||
g_ptr_array_add (priv->devices, item);
|
||||
fu_main_emit_changed (priv);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -821,6 +839,7 @@ cd_main_provider_device_removed_cb (FuProvider *provider,
|
||||
return;
|
||||
}
|
||||
g_ptr_array_remove (priv->devices, item);
|
||||
fu_main_emit_changed (priv);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user