[gnome-initial-setup/wip/pwithnall/misc-fixes: 12/15] timezone: Don’t emit a critical warning on cancellation




commit b2fbe9967dcbd59a73b2a21ea944b5067a5d4982
Author: Philip Withnall <withnall endlessm com>
Date:   Fri Sep 11 12:14:25 2020 +0100

    timezone: Don’t emit a critical warning on cancellation
    
    If the timezone page is rebuilt (due to the user selecting a different
    language in the language page), the previous GeoClue request will be
    cancelled. This was resulting in a critical warning about that. Ignore
    cancellation errors to avoid the unhelpful critical warning.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gnome-initial-setup/pages/timezone/gis-timezone-page.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
index b65e788f..0588515a 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -179,7 +179,8 @@ on_geoclue_simple_ready (GObject      *source_object,
   priv->geoclue_simple = gclue_simple_new_finish (res, &local_error);
   if (local_error != NULL)
     {
-      g_critical ("Failed to connect to GeoClue2 service: %s", local_error->message);
+      if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+        g_critical ("Failed to connect to GeoClue2 service: %s", local_error->message);
       return;
     }
 


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