weather-service: Simplify code
This commit is contained in:
@@ -709,20 +709,15 @@ on_gclue_simple_creation_cb (GClueSimple *_source,
|
|||||||
{
|
{
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
GClueLocation *location;
|
GClueLocation *location;
|
||||||
GClueSimple *location_service;
|
|
||||||
GClueClient *client;
|
GClueClient *client;
|
||||||
|
|
||||||
GCAL_ENTRY;
|
GCAL_ENTRY;
|
||||||
|
|
||||||
/*
|
self->location_service = gclue_simple_new_finish (result, &error);
|
||||||
* Make sure we do not touch self->location_service
|
|
||||||
* if the current operation was cancelled.
|
|
||||||
*/
|
|
||||||
location_service = gclue_simple_new_finish (result, &error);
|
|
||||||
|
|
||||||
if (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))
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
/* Cancelled during creation. Silently fail. */;
|
/* Cancelled during creation. Silently fail. */;
|
||||||
@@ -732,8 +727,6 @@ on_gclue_simple_creation_cb (GClueSimple *_source,
|
|||||||
GCAL_RETURN ();
|
GCAL_RETURN ();
|
||||||
}
|
}
|
||||||
|
|
||||||
self->location_service = g_steal_pointer (&location_service);
|
|
||||||
|
|
||||||
location = gclue_simple_get_location (self->location_service);
|
location = gclue_simple_get_location (self->location_service);
|
||||||
client = gclue_simple_get_client (self->location_service);
|
client = gclue_simple_get_client (self->location_service);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user