mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-20 14:10:42 +02:00
device: trivial: streamline nm_device_autoconnect_allowed()
The function returns early when autoconnect is off, so there's no reason to branch for that case below. The signal is only generated for autoconnect=true.
This commit is contained in:
parent
8b18c613ab
commit
71f92bf72d
1 changed files with 2 additions and 4 deletions
|
|
@ -2668,15 +2668,13 @@ nm_device_autoconnect_allowed (NMDevice *self)
|
|||
g_value_set_object (&instance, self);
|
||||
|
||||
g_value_init (&retval, G_TYPE_BOOLEAN);
|
||||
if (priv->autoconnect)
|
||||
g_value_set_boolean (&retval, TRUE);
|
||||
else
|
||||
g_value_set_boolean (&retval, FALSE);
|
||||
g_value_set_boolean (&retval, TRUE);
|
||||
|
||||
/* Use g_signal_emitv() rather than g_signal_emit() to avoid the return
|
||||
* value being changed if no handlers are connected */
|
||||
g_signal_emitv (&instance, signals[AUTOCONNECT_ALLOWED], 0, &retval);
|
||||
g_value_unset (&instance);
|
||||
|
||||
return g_value_get_boolean (&retval);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue