libmm-common,location-gps-raw: fix check looking for mandatory parameters

This commit is contained in:
Aleksander Morgado
2012-03-28 14:00:47 +02:00
parent 19d53751a2
commit 3f7a6fe31b

View File

@@ -276,17 +276,17 @@ mm_location_gps_raw_new_from_dictionary (GVariant *dictionary,
/* If any of the mandatory parameters is missing, cleanup */ /* If any of the mandatory parameters is missing, cleanup */
if (!self->priv->utc_time || if (!self->priv->utc_time ||
!self->priv->longitude || self->priv->longitude == MM_LOCATION_GPS_RAW_LONGITUDE_UNKNOWN ||
!self->priv->latitude) { self->priv->latitude == MM_LOCATION_GPS_RAW_LATITUDE_UNKNOWN) {
g_set_error (error, g_set_error (error,
MM_CORE_ERROR, MM_CORE_ERROR,
MM_CORE_ERROR_INVALID_ARGS, MM_CORE_ERROR_INVALID_ARGS,
"Cannot create GPS RAW location from dictionary: " "Cannot create GPS RAW location from dictionary: "
"mandatory parameters missing " "mandatory parameters missing "
"(utc-time: %s, longitude: %s, latitude: %s)", "(utc-time: %s, longitude: %s, latitude: %s)",
self->priv->utc_time ? "yes" : "no", self->priv->utc_time ? "yes" : "missing",
self->priv->longitude ? "yes" : "no", (self->priv->longitude != MM_LOCATION_GPS_RAW_LONGITUDE_UNKNOWN) ? "yes" : "missing",
self->priv->latitude ? "yes" : "no"); (self->priv->latitude != MM_LOCATION_GPS_RAW_LATITUDE_UNKNOWN) ? "yes" : "missing");
g_clear_object (&self); g_clear_object (&self);
} }