Commit a51dbcd8 authored by Benjamin Berg's avatar Benjamin Berg

network: Fix Bluetooth panel showing up after connection removal

The test to check whether the Bluetooth (simple section) contains
elements was testing for NetObjectSimple. However, ethernet connections
are a subclass and check would count these. This causes issue when the
code is run after net object removal.

The fix is to check for the exact object type rather than also allowing
subclasses.
parent 4aee26cc
......@@ -415,7 +415,8 @@ update_simple_section (CcNetworkPanel *self)
for (i = 0, n_simple = 0; i < self->devices->len; i++) {
NetObject *net_object = g_ptr_array_index (self->devices, i);
if (!NET_IS_DEVICE_SIMPLE (net_object))
/* NetDeviceSimple but none of the subclasses */
if (G_OBJECT_TYPE (net_object) != NET_TYPE_DEVICE_SIMPLE)
continue;
net_device_simple_set_show_separator (NET_DEVICE_SIMPLE (net_object), n_simple > 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment