From 4a67a3fb4225adbfab12d328ef51aa3f56c327c2 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Tue, 8 Mar 2016 17:53:46 +0100 Subject: [PATCH 1/3] gclue-service-location: create the location object at once This will allow to also set the timestamp in the future, as that property is construct only and couldn't be set if using gclue_location_new_with_description(). --- src/gclue-service-location.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/gclue-service-location.c b/src/gclue-service-location.c index ff35318..2a7b126 100644 --- a/src/gclue-service-location.c +++ b/src/gclue-service-location.c @@ -90,21 +90,16 @@ gclue_service_location_get_property (GObject *object, { GClueDBusLocation *location; GClueLocation *loc; - gdouble altitude; location = GCLUE_DBUS_LOCATION (object); - loc = gclue_location_new_with_description - (gclue_dbus_location_get_latitude (location), - gclue_dbus_location_get_longitude (location), - gclue_dbus_location_get_accuracy (location), - gclue_dbus_location_get_description (location)); - gclue_location_set_speed - (loc, gclue_dbus_location_get_speed (location)); - gclue_location_set_heading - (loc, gclue_dbus_location_get_heading (location)); - altitude = gclue_dbus_location_get_altitude (location); - if (altitude != GEOCODE_LOCATION_ALTITUDE_UNKNOWN) - g_object_set (loc, "altitude", altitude, NULL); + loc = g_object_new (GCLUE_TYPE_LOCATION, + "latitude", gclue_dbus_location_get_latitude (location), + "longitude", gclue_dbus_location_get_longitude (location), + "accuracy", gclue_dbus_location_get_accuracy (location), + "description", gclue_dbus_location_get_description (location), + "speed", gclue_dbus_location_get_speed (location), + "heading", gclue_dbus_location_get_heading (location), + "altitude", gclue_dbus_location_get_altitude (location)); g_value_take_object (value, loc); break; -- 2.7.0