about summary refs log tree commit diff
path: root/clients/cli/settings.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-09-23 10:10:27 +0200
committerMichael Biebl <biebl@debian.org>2018-09-23 10:10:27 +0200
commite126f3e804c35480c4f075777430419d6ece23da (patch)
tree5d5821ebcda8cd6ac34d2483bb3354910e508930 /clients/cli/settings.c
parentc240974325c552cad177c457d6ff04e381fd77a3 (diff)
New upstream version 1.12.4 upstream/1.12.4
Diffstat (limited to 'clients/cli/settings.c')
-rw-r--r--clients/cli/settings.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c
index 2d231e1c..01142ba2 100644
--- a/clients/cli/settings.c
+++ b/clients/cli/settings.c
@@ -318,7 +318,7 @@ _set_fcn_precheck_connection_secondaries (const char *value,
 	char **iter;
 	gboolean modified = FALSE;
 
-	strv0 = nm_utils_strsplit_set (value, " \t,", FALSE);
+	strv0 = nm_utils_strsplit_set (value, " \t,");
 	if (!strv0)
 		return TRUE;
 
@@ -662,19 +662,25 @@ nmc_setting_remove_property_option (NMSetting *setting,
 char **
 nmc_setting_get_valid_properties (NMSetting *setting)
 {
-	const NMMetaSettingInfoEditor *setting_info;
-	char **valid_props;
-	guint i, num;
-
-	setting_info = nm_meta_setting_info_editor_find_by_setting (setting);
-
-	num = setting_info ? setting_info->properties_num : 0;
-
-	valid_props = g_new (char *, num + 1);
-	for (i = 0; i < num; i++)
-		valid_props[i] = g_strdup (setting_info->properties[i]->property_name);
+	char **valid_props = NULL;
+	GParamSpec **props, **iter;
+	guint num;
+	int i;
+
+	/* Iterate through properties */
+	i = 0;
+	props = g_object_class_list_properties (G_OBJECT_GET_CLASS (G_OBJECT (setting)), &num);
+	valid_props = g_malloc0 (sizeof (char*) * (num + 1));
+	for (iter = props; iter && *iter; iter++) {
+		const char *key_name = g_param_spec_get_name (*iter);
+
+		/* Add all properties except for "name" that is non-editable */
+		if (g_strcmp0 (key_name, "name") != 0)
+			valid_props[i++] = g_strdup (key_name);
+	}
+	valid_props[i] = NULL;
+	g_free (props);
 
-	valid_props[num] = NULL;
 	return valid_props;
 }
 
@@ -808,7 +814,6 @@ setting_details (const NmcConfig *nmc_config, NMSetting *setting, const char *on
 	if (!nmc_print (nmc_config,
 	                (gpointer[]) { setting, NULL },
 	                NULL,
-	                NULL,
 	                (const NMMetaAbstractInfo *const[]) { (const NMMetaAbstractInfo *) setting_info, NULL },
 	                fields_str,
 	                &error))