summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-04-13 10:42:54 +0200
committerThomas Haller <thaller@redhat.com>2018-04-13 10:48:37 +0200
commit378833518a7f24645ec4d517cd809654cef67f88 (patch)
treeaca460fc12c8439acf73bb1f66636399a5bf3f1f
parente41db3fa558c6c58805fde5222a01773e0eb18f2 (diff)
downloadNetworkManager-378833518a7f24645ec4d517cd809654cef67f88.tar.gz
settings: return empty connections list on D-Bus util connections are loaded
We also don't emit the PropertiesChanged signal while connections are not loaded. Maybe that is wrong, in any case, the property should agree with the way how we emit notifications. So, for now, make the property agree with not notifying about connections during startup.
-rw-r--r--src/settings/nm-settings.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index 3cb0f4fab5..d42994d728 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -1872,11 +1872,14 @@ get_property (GObject *object, guint prop_id,
g_value_set_boolean (value, !!get_plugin (self, NM_SETTINGS_PLUGIN_CAP_MODIFY_CONNECTIONS));
break;
case PROP_CONNECTIONS:
- strv = nm_dbus_utils_get_paths_for_clist (&priv->connections_lst_head,
- priv->connections_len,
- G_STRUCT_OFFSET (NMSettingsConnection, _connections_lst),
- TRUE);
- g_value_take_boxed (value, nm_utils_strv_make_deep_copied (strv));
+ if (priv->connections_loaded) {
+ strv = nm_dbus_utils_get_paths_for_clist (&priv->connections_lst_head,
+ priv->connections_len,
+ G_STRUCT_OFFSET (NMSettingsConnection, _connections_lst),
+ TRUE);
+ g_value_take_boxed (value, nm_utils_strv_make_deep_copied (strv));
+ } else
+ g_value_set_boxed (value, NULL);
break;
case PROP_STARTUP_COMPLETE:
g_value_set_boolean (value, nm_settings_get_startup_complete (self));