mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 09:58:06 +02:00
daemon: Don't prepare a poll for a hidden device
We don't need to poll a device that's not registered to be visible on the bus, so check the visibility before setting that poll.
This commit is contained in:
parent
babe81a871
commit
f7142fe567
1 changed files with 3 additions and 3 deletions
|
|
@ -966,9 +966,6 @@ up_daemon_device_added_cb (UpBackend *backend, UpDevice *device, UpDaemon *daemo
|
|||
g_signal_connect (device, "notify",
|
||||
G_CALLBACK (up_daemon_device_changed_cb), daemon);
|
||||
|
||||
/* Ensure we poll the new device if needed */
|
||||
g_source_set_ready_time (daemon->priv->poll_source, 0);
|
||||
|
||||
/* emit */
|
||||
object_path = up_device_get_object_path (device);
|
||||
if (object_path == NULL) {
|
||||
|
|
@ -977,6 +974,9 @@ up_daemon_device_added_cb (UpBackend *backend, UpDevice *device, UpDaemon *daemo
|
|||
return;
|
||||
}
|
||||
|
||||
/* Ensure we poll the new device if needed */
|
||||
g_source_set_ready_time (daemon->priv->poll_source, 0);
|
||||
|
||||
g_debug ("emitting added: %s", object_path);
|
||||
up_daemon_update_warning_level (daemon);
|
||||
up_exported_daemon_emit_device_added (UP_EXPORTED_DAEMON (daemon), object_path);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue