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.
This commit is contained in:
parent
4aee26cc77
commit
a51dbcd8ca
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue