From 7c4b5a44127eb0d1f1669fa49b5e32dbcbb4bd38 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 6 Aug 2015 13:23:56 +0200 Subject: [PATCH] device: let NM_DEVICE_MASTER be equal to nm_device_get_master() There is only one user of the NM_DEVICE_MASTER property (NMActiveConnection). device_master_changed() uses the property for change notifications, but returns early if !nm_device_get_master(). We might emit the "notify::master" signal too often, even when nothing changed (because currently we always emit it when priv->master changes). If we would fix that to only emit the signal when nm_device_get_master() actually changes, it would still be correct, because device_master_changed() doesn't care about notifications when the master is unset. Hence, the only user doesn't care about the difference. So change it because it's unexpected that the property and function are not completely equal. --- src/devices/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 77f3e2031b..54b02534df 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -10130,7 +10130,7 @@ get_property (GObject *object, guint prop_id, g_value_set_boolean (value, priv->is_master); break; case PROP_MASTER: - g_value_set_object (value, priv->master); + g_value_set_object (value, nm_device_get_master (self)); break; case PROP_HW_ADDRESS: g_value_set_string (value, priv->hw_addr);