summary refs log tree commit diff
path: root/clients/cli/general.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-06-28 18:58:14 +0200
committerMichael Biebl <biebl@debian.org>2020-06-28 18:58:14 +0200
commita54ac63bbf9b2c71026ac9028a8ffaf186cf3c82 (patch)
tree6a32883bd916c4096357b35298beff6db8bcd0b5 /clients/cli/general.c
parent45e8e1149027529194982212c804c0468aa01d98 (diff)
New upstream version 1.25.90 upstream/1.25.90
Diffstat (limited to 'clients/cli/general.c')
-rw-r--r--clients/cli/general.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 747203bb..a771e1d5 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -545,7 +545,9 @@ print_permissions (void *user_data)
 	}
 
 	if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+		/* pass */
 	} else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+		/* pass */
 	} else
 		fields_str = nmc->required_fields;
 
@@ -694,7 +696,9 @@ show_general_logging (NmCli *nmc)
 	};
 
 	if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+		/* pass */
 	} else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+		/* pass */
 	} else
 		fields_str = nmc->required_fields;
 
@@ -1404,15 +1408,12 @@ nmc_command_func_overview (const NMCCommand *cmd, NmCli *nmc, int argc, const ch
 	/* The VPN connections don't have devices (yet?). */
 	p = nm_client_get_active_connections (nmc->client);
 	for (i = 0; i < p->len; i++) {
-		NMActiveConnectionState state;
-
 		ac = p->pdata[i];
 
 		if (!nm_active_connection_get_vpn (ac))
 			continue;
 
-		state = nm_active_connection_get_state (ac);
-		color = nmc_active_connection_state_to_color (state);
+		color = nmc_active_connection_state_to_color (ac);
 		tmp = nmc_colorize (&nmc->nmc_config, color, _("%s VPN connection"),
 		                    nm_active_connection_get_id (ac));
 		g_print ("%s\n", tmp);
@@ -1424,33 +1425,32 @@ nmc_command_func_overview (const NMCCommand *cmd, NmCli *nmc, int argc, const ch
 
 	devices = nmc_get_devices_sorted (nmc->client);
 	for (i = 0; devices[i]; i++) {
-		NMDeviceState state;
+		NMDevice *device = devices[i];
 
-		ac = nm_device_get_active_connection (devices[i]);
+		ac = nm_device_get_active_connection (device);
 
-		state = nm_device_get_state (devices[i]);
-		color = nmc_device_state_to_color (state);
+		color = nmc_device_state_to_color (device);
 		if (ac) {
 			/* TRANSLATORS: prints header line for activated device in plain `nmcli` overview output as
 			 * "<interface-name>: <device-state> to <connection-id>" */
 			tmp = nmc_colorize (&nmc->nmc_config, color, C_("nmcli-overview", "%s: %s to %s"),
-			                    nm_device_get_iface (devices[i]),
-			                    gettext (nmc_device_state_to_string (state)),
+			                    nm_device_get_iface (device),
+			                    gettext (nmc_device_state_to_string_with_external (device)),
 			                    nm_active_connection_get_id (ac));
 		} else {
 			/* TRANSLATORS: prints header line for not active device in plain `nmcli` overview output as
 			 * "<interface-name>: <device-state>" */
 			tmp = nmc_colorize (&nmc->nmc_config, color, C_("nmcli-overview", "%s: %s"),
-			                    nm_device_get_iface (devices[i]),
-			                    gettext (nmc_device_state_to_string (state)));
+			                    nm_device_get_iface (device),
+			                    gettext (nmc_device_state_to_string_with_external (device)));
 		}
 		g_print ("%s\n", tmp);
 		g_free (tmp);
 
-		if (nm_device_get_description (devices[i]) && strcmp (nm_device_get_description (devices[i]), ""))
-			g_print ("\t\"%s\"\n", nm_device_get_description (devices[i]));
+		if (nm_device_get_description (device) && strcmp (nm_device_get_description (device), ""))
+			g_print ("\t\"%s\"\n", nm_device_get_description (device));
 
-		device_overview (nmc, devices[i]);
+		device_overview (nmc, device);
 		if (ac)
 			ac_overview (nmc, ac);
 		g_print ("\n");