[gnome-control-center/benzea/ignore-more-network-devices: 47/47] network: Don't shorten names of bluetooth connections



commit f7c866502a73fa2b80ca633cc1eb9dec5b0d5d53
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Mar 21 14:24:04 2019 +0100

    network: Don't shorten names of bluetooth connections
    
    This prevents a single bluetooth connection to be shortened to the name
    "Bluetooth", which means we end up with one "Bluetooth" device in the
    "Bluetooth" section. Rather, always use the long name of the bluetooth
    device so that the user knows what they are connecting to.

 panels/network/cc-network-panel.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 1a305578b..99e3b5c9a 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -301,7 +301,17 @@ panel_refresh_device_titles (CcNetworkPanel *panel)
 
         titles = nm_device_disambiguate_names (nm_devices, num_devices);
         for (i = 0; i < num_devices; i++) {
-                net_object_set_title (NET_OBJECT (devices[i]), titles[i]);
+                /* FIXME: Try to not simplify bluetooth devices. Otherwise we can
+                 *        end up with the informative "Bluetooth" name, which does
+                 *        not tell the user which bluetooth device they are connecting
+                 *        to.
+                 *        This logic is a bit agressive in the theoretical case that
+                 *        the user has multiple bluetooth dongles (which we currently
+                 *        don't support in GNOME). */
+                if (NM_IS_DEVICE_BT (nm_devices[i]) && nm_device_bt_get_name (NM_DEVICE_BT (nm_devices[i])))
+                        net_object_set_title (NET_OBJECT (devices[i]), nm_device_bt_get_name (NM_DEVICE_BT 
(nm_devices[i])));
+                else
+                        net_object_set_title (NET_OBJECT (devices[i]), titles[i]);
                 g_free (titles[i]);
         }
         g_free (titles);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]