From 702c089c171f69096a94df0f6d70872b8784578e Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 27 Jan 2018 14:30:02 -0200 Subject: [PATCH] weather-service: Simplify code --- src/gcal-weather-service.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gcal-weather-service.c b/src/gcal-weather-service.c index 3ebc9c1b..3639ffca 100644 --- a/src/gcal-weather-service.c +++ b/src/gcal-weather-service.c @@ -709,20 +709,15 @@ on_gclue_simple_creation_cb (GClueSimple *_source, { g_autoptr (GError) error = NULL; GClueLocation *location; - GClueSimple *location_service; GClueClient *client; GCAL_ENTRY; - /* - * Make sure we do not touch self->location_service - * if the current operation was cancelled. - */ - location_service = gclue_simple_new_finish (result, &error); + self->location_service = gclue_simple_new_finish (result, &error); if (error) { - g_assert_null (location_service); + g_assert_null (self->location_service); if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) /* Cancelled during creation. Silently fail. */; @@ -732,8 +727,6 @@ on_gclue_simple_creation_cb (GClueSimple *_source, GCAL_RETURN (); } - self->location_service = g_steal_pointer (&location_service); - location = gclue_simple_get_location (self->location_service); client = gclue_simple_get_client (self->location_service);