summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-01-03 23:18:28 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2017-01-04 11:41:30 +0100
commitde10ae4a42e5bfdd01cdd0eaac7cef43b5840723 (patch)
treea97cd6ce3f1bab71e42fddaebc0ce67ab48fa0e7
parent6937c9fbc892f6d6633faa054d780e62cf6f8227 (diff)
downloadnetwork-manager-applet-de10ae4a42e5bfdd01cdd0eaac7cef43b5840723.tar.gz
editor: hide device MAC from combo when NULL
Hide the device MAC address from the device combo when the device doesn't have a permanent MAC. https://bugzilla.redhat.com/show_bug.cgi?id=1380424
-rw-r--r--src/connection-editor/ce-page.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 2e9e1307..68c0e04b 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -370,14 +370,18 @@ _get_device_list (CEPage *self,
if (mac_property)
g_object_get (G_OBJECT (dev), mac_property, &mac, NULL);
+ if (mac && !mac[0])
+ nm_clear_g_free (&mac);
+
if (set_ifname && mac_property)
- item = g_strdup_printf ("%s (%s)", ifname, mac);
+ item = g_strdup_printf ("%s%s%s%s", ifname, NM_PRINT_FMT_QUOTED (mac, " (", mac, ")", ""));
else
item = g_strdup (set_ifname ? ifname : mac);
- g_ptr_array_add (interfaces, item);
- if (mac_property)
- g_free (mac);
+ if (item)
+ g_ptr_array_add (interfaces, item);
+
+ g_free (mac);
}
g_ptr_array_add (interfaces, NULL);