[gnome-control-center] power: Fix mobile broadband switch logic
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] power: Fix mobile broadband switch logic
- Date: Thu, 13 Feb 2020 21:23:30 +0000 (UTC)
commit be1c9ac1d69d3b3ce2dc5867f998702cac730837
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Thu Nov 14 13:56:17 2019 +0530
power: Fix mobile broadband switch logic
Let the power switch be active (ie, powersave set to off) if either
of wimax or wwan device is enabled. And set the switch sensitive
if either of them present.
panels/power/cc-power-panel.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 7624dcd3f..b1ff59db6 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -1547,11 +1547,16 @@ nm_client_state_changed (NMClient *client,
g_signal_handlers_unblock_by_func (self->wifi_switch, wifi_switch_changed, self);
visible = has_mobile_devices (self->nm_client);
+
+ /* Set the switch active, if either of wimax or wwan is enabled. */
active = nm_client_networking_get_enabled (client) &&
- nm_client_wimax_get_enabled (client) &&
- nm_client_wireless_hardware_get_enabled (client);
+ ((nm_client_wimax_get_enabled (client) &&
+ nm_client_wimax_hardware_get_enabled (client)) ||
+ (nm_client_wwan_get_enabled (client) &&
+ nm_client_wwan_hardware_get_enabled (client)));
sensitive = nm_client_networking_get_enabled (client) &&
- nm_client_wireless_hardware_get_enabled (client);
+ (nm_client_wwan_hardware_get_enabled (client) ||
+ nm_client_wimax_hardware_get_enabled (client));
g_debug ("mobile state changed to %s", active ? "enabled" : "disabled");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]