diff options
author | Andrea Azzarone <azzaronea@gmail.com> | 2018-05-07 17:01:20 +0200 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-05-12 02:31:12 +0000 |
commit | f9b65046e9b6912ee7ea8db16a8fde9090879517 (patch) | |
tree | 7404a6dbfd3a68251c0d1a8dd18a3db356ec6f1d | |
parent | f3257ce82a1f7db6eac649fa5d26d487ea946a85 (diff) | |
download | gnome-control-center-f9b65046e9b6912ee7ea8db16a8fde9090879517.tar.gz |
night-light-dialog: Ignore G_IO_ERROR_CANCELLED errors
We should ignore G_IO_ERROR_CANCELLED errors and avoid displaying useless
warnings. Also use g_clear_object instead of g_object_unref.
Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/87
-rw-r--r-- | panels/display/cc-night-light-dialog.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/panels/display/cc-night-light-dialog.c b/panels/display/cc-night-light-dialog.c index b26b9e3e5..55fca2429 100644 --- a/panels/display/cc-night-light-dialog.c +++ b/panels/display/cc-night-light-dialog.c @@ -79,11 +79,11 @@ cc_night_light_dialog_finalize (GObject *object) self->main_window = NULL; } - g_object_unref (self->builder); - g_object_unref (self->proxy_color); - g_object_unref (self->proxy_color_props); - g_object_unref (self->settings_display); - g_object_unref (self->settings_clock); + g_clear_object (&self->builder); + g_clear_object (&self->proxy_color); + g_clear_object (&self->proxy_color_props); + g_clear_object (&self->settings_display); + g_clear_object (&self->settings_clock); if (self->timer_id > 0) g_source_remove (self->timer_id); @@ -392,7 +392,8 @@ dialog_got_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_da proxy = cc_object_storage_create_dbus_proxy_finish (res, &error); if (proxy == NULL) { - g_warning ("failed to connect to g-s-d: %s", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("failed to connect to g-s-d: %s", error->message); return; } @@ -414,7 +415,8 @@ dialog_got_proxy_props_cb (GObject *source_object, GAsyncResult *res, gpointer u proxy = cc_object_storage_create_dbus_proxy_finish (res, &error); if (proxy == NULL) { - g_warning ("failed to connect to g-s-d: %s", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("failed to connect to g-s-d: %s", error->message); return; } |