[gnome-control-center] wwan: Fix signal strength display when extended signal retrieval is disabled



commit 6e5169ad4dacce7558a9aed8e4663905e2413d89
Author: Sebastian Krzyszkowiak <sebastian krzyszkowiak puri sm>
Date:   Mon Jul 6 04:33:30 2020 +0200

    wwan: Fix signal strength display when extended signal retrieval is disabled
    
    MMModemSignal interface is used to retrieve extended signal information that
    requires periodic polling. Therefore, it needs to be manually enabled in order
    to use. There if a fallback to use mm_modem_get_signal_quality when MMModemSignal
    interface is unavailable, but it didn't check whether it's actually enabled,
    leaving the UI with empty label.

 panels/wwan/cc-wwan-device.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/panels/wwan/cc-wwan-device.c b/panels/wwan/cc-wwan-device.c
index 31baff95c..55a627a5a 100644
--- a/panels/wwan/cc-wwan-device.c
+++ b/panels/wwan/cc-wwan-device.c
@@ -1183,12 +1183,16 @@ cc_wwan_device_dup_signal_string (CcWwanDevice *self)
   GString *str;
   gdouble value;
   gboolean recent;
+  guint refresh_rate;
 
   g_return_val_if_fail (CC_IS_WWAN_DEVICE (self), NULL);
 
   modem_signal = mm_object_peek_modem_signal (self->mm_object);
 
-  if (!modem_signal)
+  if (modem_signal)
+    refresh_rate = mm_modem_signal_get_rate (modem_signal);
+
+  if (!modem_signal || !refresh_rate)
     return g_strdup_printf ("%d%%", mm_modem_get_signal_quality (self->modem, &recent));
 
   str = g_string_new ("");


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