summaryrefslogtreecommitdiff
path: root/src/connection-editor/ce-page.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection-editor/ce-page.c')
-rw-r--r--src/connection-editor/ce-page.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 3f79c22b..d8425d8e 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -308,7 +308,10 @@ _get_device_list (CEPage *self,
if (!G_TYPE_CHECK_INSTANCE_TYPE (dev, device_type))
continue;
- ifname = nm_device_get_iface (NM_DEVICE (dev));
+ if (device_type == NM_TYPE_DEVICE_BT)
+ ifname = nm_device_bt_get_name (NM_DEVICE_BT (dev));
+ else
+ ifname = nm_device_get_iface (NM_DEVICE (dev));
if (mac_property)
g_object_get (G_OBJECT (dev), mac_property, &mac, NULL);
@@ -340,7 +343,7 @@ _device_entry_parse (const char *entry_text, char **first, char **second)
return TRUE;
}
- sp = strchr (entry_text, ' ');
+ sp = strstr (entry_text, " (");
if (sp) {
*first = g_strndup (entry_text, sp - entry_text);
left = sp + 1;
@@ -432,7 +435,8 @@ ce_page_setup_device_combo (CEPage *self,
}
gboolean
-ce_page_device_entry_get (GtkEntry *entry, int type, char **ifname, char **mac, const char *device_name, GError **error)
+ce_page_device_entry_get (GtkEntry *entry, int type, gboolean check_ifname,
+ char **ifname, char **mac, const char *device_name, GError **error)
{
char *first, *second;
const char *ifname_tmp = NULL, *mac_tmp = NULL;
@@ -449,7 +453,7 @@ ce_page_device_entry_get (GtkEntry *entry, int type, char **ifname, char **mac,
if (first) {
if (nm_utils_hwaddr_valid (first, nm_utils_hwaddr_len (type)))
mac_tmp = first;
- else if (nm_utils_iface_valid_name (first))
+ else if (!check_ifname || nm_utils_iface_valid_name (first))
ifname_tmp = first;
else
valid = FALSE;
@@ -460,7 +464,7 @@ ce_page_device_entry_get (GtkEntry *entry, int type, char **ifname, char **mac,
mac_tmp = second;
else
valid = FALSE;
- } else if (nm_utils_iface_valid_name (second)) {
+ } else if (!check_ifname || nm_utils_iface_valid_name (second)) {
if (!ifname_tmp)
ifname_tmp = second;
else