Commit f82aa454 authored by Bastien Nocera's avatar Bastien Nocera

Remove custom GClueLocationInfo object

And use a copy-pasted version of geocode-glib's GeocodeLocation
object instead, so we don't end up duplicating bug fixes in
both projects.
parent bf7371e9
......@@ -31,8 +31,6 @@ geoclue_SOURCES = \
gclue-error.c \
gclue-ipclient.h \
gclue-ipclient.c \
gclue-location-info.h \
gclue-location-info.c \
gclue-locator.h \
gclue-locator.c \
gclue-service-manager.h \
......@@ -41,6 +39,8 @@ geoclue_SOURCES = \
gclue-service-client.c \
gclue-service-location.h \
gclue-service-location.c \
geocode-location.c \
geocode-location.h \
$(NULL)
geoclue_CFLAGS = $(GEOCLUE_CFLAGS) \
......
......@@ -29,6 +29,7 @@
#include "gclue-ipclient.h"
#include "gclue-error.h"
#include "geoip-server/geoip-server.h"
#include "geocode-location.h"
/**
* SECTION:gclue-ipclient
......@@ -395,17 +396,17 @@ static gdouble
get_accuracy_from_string (const char *str)
{
if (strcmp (str, "street") == 0)
return GCLUE_LOCATION_INFO_ACCURACY_STREET;
return GEOCODE_LOCATION_ACCURACY_STREET;
else if (strcmp (str, "city") == 0)
return GCLUE_LOCATION_INFO_ACCURACY_CITY;
return GEOCODE_LOCATION_ACCURACY_CITY;
else if (strcmp (str, "region") == 0)
return GCLUE_LOCATION_INFO_ACCURACY_REGION;
return GEOCODE_LOCATION_ACCURACY_REGION;
else if (strcmp (str, "country") == 0)
return GCLUE_LOCATION_INFO_ACCURACY_COUNTRY;
return GEOCODE_LOCATION_ACCURACY_COUNTRY;
else if (strcmp (str, "continent") == 0)
return GCLUE_LOCATION_INFO_ACCURACY_CONTINENT;
return GEOCODE_LOCATION_ACCURACY_CONTINENT;
else
return GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN;
return GEOCODE_LOCATION_ACCURACY_UNKNOWN;
}
static gdouble
......@@ -417,28 +418,28 @@ get_accuracy_from_json_location (JsonObject *object)
str = json_object_get_string_member (object, "accuracy");
return get_accuracy_from_string (str);
} else if (json_object_has_member (object, "street")) {
return GCLUE_LOCATION_INFO_ACCURACY_STREET;
return GEOCODE_LOCATION_ACCURACY_STREET;
} else if (json_object_has_member (object, "city")) {
return GCLUE_LOCATION_INFO_ACCURACY_CITY;
return GEOCODE_LOCATION_ACCURACY_CITY;
} else if (json_object_has_member (object, "region_name")) {
return GCLUE_LOCATION_INFO_ACCURACY_REGION;
return GEOCODE_LOCATION_ACCURACY_REGION;
} else if (json_object_has_member (object, "country_name")) {
return GCLUE_LOCATION_INFO_ACCURACY_COUNTRY;
return GEOCODE_LOCATION_ACCURACY_COUNTRY;
} else if (json_object_has_member (object, "continent")) {
return GCLUE_LOCATION_INFO_ACCURACY_CONTINENT;
return GEOCODE_LOCATION_ACCURACY_CONTINENT;
} else {
return GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN;
return GEOCODE_LOCATION_ACCURACY_UNKNOWN;
}
}
static GClueLocationInfo *
static GeocodeLocation *
_gclue_ip_json_to_location (const char *json,
GError **error)
{
JsonParser *parser;
JsonNode *node;
JsonObject *object;
GClueLocationInfo *location;
GeocodeLocation *location;
gdouble latitude, longitude, accuracy;
char *desc = NULL;
......@@ -457,7 +458,7 @@ _gclue_ip_json_to_location (const char *json,
longitude = json_object_get_double_member (object, "longitude");
accuracy = get_accuracy_from_json_location (object);
location = gclue_location_info_new (latitude, longitude, accuracy);
location = geocode_location_new (latitude, longitude, accuracy);
if (json_object_has_member (object, "country_name")) {
if (json_object_has_member (object, "region_name")) {
......@@ -478,7 +479,7 @@ _gclue_ip_json_to_location (const char *json,
}
if (desc != NULL) {
gclue_location_info_set_description (location, desc);
geocode_location_set_description (location, desc);
g_free (desc);
}
......@@ -495,17 +496,17 @@ _gclue_ip_json_to_location (const char *json,
*
* Finishes a geolocation search operation. See gclue_ipclient_search_async().
*
* Returns: (transfer full): A #GClueLocationInfo object or %NULL in case of
* Returns: (transfer full): A #GeocodeLocation object or %NULL in case of
* errors. Free the returned object with g_object_unref() when done.
**/
GClueLocationInfo *
GeocodeLocation *
gclue_ipclient_search_finish (GClueIpclient *ipclient,
GAsyncResult *res,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
char *contents = NULL;
GClueLocationInfo *location;
GeocodeLocation *location;
g_return_val_if_fail (GCLUE_IS_IPCLIENT (ipclient), NULL);
......@@ -529,16 +530,16 @@ gclue_ipclient_search_finish (GClueIpclient *ipclient,
*
* Gets the geolocation data for an IP address from the server.
*
* Returns: (transfer full): A #GClueLocationInfo object or %NULL in case of
* Returns: (transfer full): A #GeocodeLocation object or %NULL in case of
* errors. Free the returned object with g_object_unref() when done.
**/
GClueLocationInfo *
GeocodeLocation *
gclue_ipclient_search (GClueIpclient *ipclient,
GError **error)
{
char *contents;
SoupMessage *query;
GClueLocationInfo *location;
GeocodeLocation *location;
g_return_val_if_fail (GCLUE_IS_IPCLIENT (ipclient), NULL);
g_return_val_if_fail (ipclient->priv->server != NULL, NULL);
......
......@@ -26,7 +26,7 @@
#include <glib.h>
#include <gio/gio.h>
#include "gclue-location-info.h"
#include "geocode-location.h"
G_BEGIN_DECLS
......@@ -72,11 +72,11 @@ void gclue_ipclient_search_async (GClueIpclient *ipclient,
GAsyncReadyCallback callback,
gpointer user_data);
GClueLocationInfo *gclue_ipclient_search_finish (GClueIpclient *ipclient,
GeocodeLocation *gclue_ipclient_search_finish (GClueIpclient *ipclient,
GAsyncResult *res,
GError **error);
GClueLocationInfo *gclue_ipclient_search (GClueIpclient *ipclient,
GeocodeLocation *gclue_ipclient_search (GClueIpclient *ipclient,
GError **error);
G_END_DECLS
......
/* vim: set et ts=8 sw=8: */
/* gclue-location-info.c
*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2012 Bastien Nocera
*
* Geoclue is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Geoclue is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with Geoclue; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: Bastien Nocera <hadess@hadess.net>
* Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
*/
#include "gclue-location-info.h"
#include <math.h>
#define EARTH_RADIUS_KM 6372.795
/**
* SECTION:gclue-location
* @short_description: GClue location object
* @include: gclue-glib/gclue-glib.h
*
* The #GClueLocationInfo instance represents a location on earth, with an
* optional description.
**/
struct _GClueLocationInfoPrivate {
gdouble longitude;
gdouble latitude;
gdouble accuracy;
guint64 timestamp;
char *description;
};
enum {
PROP_0,
PROP_LATITUDE,
PROP_LONGITUDE,
PROP_ACCURACY,
PROP_DESCRIPTION,
PROP_TIMESTAMP
};
G_DEFINE_TYPE (GClueLocationInfo, gclue_location_info, G_TYPE_OBJECT)
static void
gclue_location_info_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GClueLocationInfo *location = GCLUE_LOCATION_INFO (object);
switch (property_id) {
case PROP_DESCRIPTION:
g_value_set_string (value,
gclue_location_info_get_description (location));
break;
case PROP_LATITUDE:
g_value_set_double (value,
gclue_location_info_get_latitude (location));
break;
case PROP_LONGITUDE:
g_value_set_double (value,
gclue_location_info_get_longitude (location));
break;
case PROP_ACCURACY:
g_value_set_double (value,
gclue_location_info_get_accuracy (location));
break;
case PROP_TIMESTAMP:
g_value_set_uint64 (value,
gclue_location_info_get_timestamp (location));
break;
default:
/* We don't have any other property... */
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gclue_location_info_set_latitude (GClueLocationInfo *loc,
gdouble latitude)
{
g_return_if_fail (latitude >= -90.0 && latitude <= 90.0);
loc->priv->latitude = latitude;
}
static void
gclue_location_info_set_longitude (GClueLocationInfo *loc,
gdouble longitude)
{
g_return_if_fail (longitude >= -180.0 && longitude <= 180.0);
loc->priv->longitude = longitude;
}
static void
gclue_location_info_set_accuracy (GClueLocationInfo *loc,
gdouble accuracy)
{
g_return_if_fail (accuracy >= GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN);
loc->priv->accuracy = accuracy;
}
static void
gclue_location_info_set_property(GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GClueLocationInfo *location = GCLUE_LOCATION_INFO (object);
switch (property_id) {
case PROP_DESCRIPTION:
gclue_location_info_set_description (location,
g_value_get_string (value));
break;
case PROP_LATITUDE:
gclue_location_info_set_latitude (location,
g_value_get_double (value));
break;
case PROP_LONGITUDE:
gclue_location_info_set_longitude (location,
g_value_get_double (value));
break;
case PROP_ACCURACY:
gclue_location_info_set_accuracy (location,
g_value_get_double (value));
break;
default:
/* We don't have any other property... */
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gclue_location_info_finalize (GObject *glocation)
{
GClueLocationInfo *location = (GClueLocationInfo *) glocation;
g_clear_pointer (&location->priv->description, g_free);
G_OBJECT_CLASS (gclue_location_info_parent_class)->finalize (glocation);
}
static void
gclue_location_info_class_init (GClueLocationInfoClass *klass)
{
GObjectClass *glocation_class = G_OBJECT_CLASS (klass);
GParamSpec *pspec;
glocation_class->finalize = gclue_location_info_finalize;
glocation_class->get_property = gclue_location_info_get_property;
glocation_class->set_property = gclue_location_info_set_property;
g_type_class_add_private (klass, sizeof (GClueLocationInfoPrivate));
/**
* GClueLocationInfo:description:
*
* The description of this location.
*/
pspec = g_param_spec_string ("description",
"Description",
"Description of this location",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property (glocation_class, PROP_DESCRIPTION, pspec);
/**
* GClueLocationInfo:latitude:
*
* The latitude of this location in degrees.
*/
pspec = g_param_spec_double ("latitude",
"Latitude",
"The latitude of this location in degrees",
-90.0,
90.0,
0.0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property (glocation_class, PROP_LATITUDE, pspec);
/**
* GClueLocationInfo:longitude:
*
* The longitude of this location in degrees.
*/
pspec = g_param_spec_double ("longitude",
"Longitude",
"The longitude of this location in degrees",
-180.0,
180.0,
0.0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property (glocation_class, PROP_LONGITUDE, pspec);
/**
* GClueLocationInfo:accuracy:
*
* The accuracy of this location in meters.
*/
pspec = g_param_spec_double ("accuracy",
"Accuracy",
"The accuracy of this location in meters",
GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN,
G_MAXDOUBLE,
GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property (glocation_class, PROP_ACCURACY, pspec);
/**
* GClueLocationInfo:timestamp:
*
* A timestamp in seconds since
* <ulink url="http://en.wikipedia.org/wiki/Unix_epoch">Epoch</ulink>.
*/
pspec = g_param_spec_uint64 ("timestamp",
"Timestamp",
"The timestamp of this location "
"in seconds since Epoch",
0,
G_MAXINT64,
0,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_property (glocation_class, PROP_TIMESTAMP, pspec);
}
static void
gclue_location_info_init (GClueLocationInfo *location)
{
GTimeVal tv;
location->priv = G_TYPE_INSTANCE_GET_PRIVATE ((location),
GCLUE_TYPE_LOCATION_INFO,
GClueLocationInfoPrivate);
g_get_current_time (&tv);
location->priv->timestamp = tv.tv_sec;
}
/**
* gclue_location_info_new:
* @latitude: a valid latitude
* @longitude: a valid longitude
* @accuracy: accuracy of location in meters
*
* Creates a new #GClueLocationInfo object.
*
* Returns: a new #GClueLocationInfo object. Use g_object_unref() when done.
**/
GClueLocationInfo *
gclue_location_info_new (gdouble latitude,
gdouble longitude,
gdouble accuracy)
{
return g_object_new (GCLUE_TYPE_LOCATION_INFO,
"latitude", latitude,
"longitude", longitude,
"accuracy", accuracy,
NULL);
}
/**
* gclue_location_info_new_with_description:
* @latitude: a valid latitude
* @longitude: a valid longitude
* @accuracy: accuracy of location in meters
* @description: a description for the location
*
* Creates a new #GClueLocationInfo object.
*
* Returns: a new #GClueLocationInfo object. Use g_object_unref() when done.
**/
GClueLocationInfo *
gclue_location_info_new_with_description (gdouble latitude,
gdouble longitude,
gdouble accuracy,
const char *description)
{
return g_object_new (GCLUE_TYPE_LOCATION_INFO,
"latitude", latitude,
"longitude", longitude,
"accuracy", accuracy,
"description", description,
NULL);
}
/**
* gclue_location_info_set_description:
* @description: a description for the location
*
* Sets the description of @loc to @description.
**/
void
gclue_location_info_set_description (GClueLocationInfo *loc,
const char *description)
{
g_return_if_fail (GCLUE_IS_LOCATION_INFO (loc));
g_free (loc->priv->description);
loc->priv->description = g_strdup (description);
}
const char *
gclue_location_info_get_description (GClueLocationInfo *loc)
{
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (loc), NULL);
return loc->priv->description;
}
gdouble
gclue_location_info_get_latitude (GClueLocationInfo *loc)
{
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (loc), 0.0);
return loc->priv->latitude;
}
gdouble
gclue_location_info_get_longitude (GClueLocationInfo *loc)
{
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (loc), 0.0);
return loc->priv->longitude;
}
gdouble
gclue_location_info_get_accuracy (GClueLocationInfo *loc)
{
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (loc),
GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN);
return loc->priv->accuracy;
}
guint64
gclue_location_info_get_timestamp (GClueLocationInfo *loc)
{
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (loc), -1);
return loc->priv->timestamp;
}
/**
* gclue_location_info_get_distance_from:
* @loca: a #GClueLocationInfo
* @locb: a #GClueLocationInfo
*
* Calculates the distance in km, along the curvature of the Earth,
* between 2 locations. Note that altitude changes are not
* taken into account.
*
* Returns: a distance in km.
**/
double
gclue_location_info_get_distance_from (GClueLocationInfo *loca,
GClueLocationInfo *locb)
{
gdouble dlat, dlon, lat1, lat2;
gdouble a, c;
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (loca), 0.0);
g_return_val_if_fail (GCLUE_IS_LOCATION_INFO (locb), 0.0);
/* Algorithm from:
* http://www.movable-type.co.uk/scripts/latlong.html */
dlat = (locb->priv->latitude - loca->priv->latitude) * M_PI / 180.0;
dlon = (locb->priv->longitude - loca->priv->longitude) * M_PI / 180.0;
lat1 = loca->priv->latitude * M_PI / 180.0;
lat2 = locb->priv->latitude * M_PI / 180.0;
a = sin (dlat / 2) * sin (dlat / 2) +
sin (dlon / 2) * sin (dlon / 2) * cos (lat1) * cos (lat2);
c = 2 * atan2 (sqrt (a), sqrt (1-a));
return EARTH_RADIUS_KM * c;
}
/* vim: set et ts=8 sw=8: */
/* gclue-location-info.h
*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2012 Bastien Nocera
*
* Geoclue is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* Geoclue is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with Geoclue; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: Bastien Nocera <hadess@hadess.net>
* Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
*/
#ifndef GCLUE_LOCATION_INFO_H
#define GCLUE_LOCATION_INFO_H
#include <glib-object.h>
G_BEGIN_DECLS
GType gclue_location_info_get_type (void) G_GNUC_CONST;
#define GCLUE_TYPE_LOCATION_INFO (gclue_location_info_get_type ())
#define GCLUE_LOCATION_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCLUE_TYPE_LOCATION_INFO, GClueLocationInfo))
#define GCLUE_IS_LOCATION_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCLUE_TYPE_LOCATION_INFO))
#define GCLUE_LOCATION_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCLUE_TYPE_LOCATION_INFO, GClueLocationInfoClass))
#define GCLUE_IS_LOCATION_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCLUE_TYPE_LOCATION_INFO))
#define GCLUE_LOCATION_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCLUE_TYPE_LOCATION_INFO, GClueLocationInfoClass))
typedef struct _GClueLocationInfo GClueLocationInfo;
typedef struct _GClueLocationInfoClass GClueLocationInfoClass;
typedef struct _GClueLocationInfoPrivate GClueLocationInfoPrivate;
/**
* GClueLocationInfo:
*
* All the fields in the #GClueLocationInfo structure are private and should never be accessed directly.
**/
struct _GClueLocationInfo {
/* <private> */
GObject parent_instance;
GClueLocationInfoPrivate *priv;
};
/**
* GClueLocationInfoClass:
*
* All the fields in the #GClueLocationInfoClass structure are private and should never be accessed directly.
**/
struct _GClueLocationInfoClass {
/* <private> */
GObjectClass parent_class;
};
#define GCLUE_LOCATION_INFO_ACCURACY_UNKNOWN -1
#define GCLUE_LOCATION_INFO_ACCURACY_STREET 1000 /* 1 km */
#define GCLUE_LOCATION_INFO_ACCURACY_CITY 15000 /* 15 km */
#define GCLUE_LOCATION_INFO_ACCURACY_REGION 50000 /* 50 km */
#define GCLUE_LOCATION_INFO_ACCURACY_COUNTRY 300000 /* 300 km */
#define GCLUE_LOCATION_INFO_ACCURACY_CONTINENT 3000000 /* 3000 km */
GClueLocationInfo *gclue_location_info_new (gdouble latitude,
gdouble longitude,
gdouble accuracy);
GClueLocationInfo *gclue_location_info_new_with_description (gdouble latitude,
gdouble longitude,
gdouble accuracy,
const char *description);
double gclue_location_info_get_distance_from (GClueLocationInfo *loca,
GClueLocationInfo *locb);
void gclue_location_info_set_description (GClueLocationInfo *loc,
const char *description);
const char *gclue_location_info_get_description (GClueLocationInfo *loc);
gdouble gclue_location_info_get_latitude (GClueLocationInfo *loc);
gdouble gclue_location_info_get_longitude (GClueLocationInfo *loc);
gdouble gclue_location_info_get_accuracy (GClueLocationInfo *loc);
guint64 gclue_location_info_get_timestamp (GClueLocationInfo *loc);
G_END_DECLS
#endif /* GCLUE_LOCATION_INFO_H */
......@@ -33,7 +33,7 @@ struct _GClueLocatorPrivate
{
GClueIpclient *ipclient;
GClueLocationInfo *location;
GeocodeLocation *location;
GCancellable *cancellable;
......@@ -107,7 +107,7 @@ gclue_locator_class_init (GClueLocatorClass *klass)
gParamSpecs[PROP_LOCATION] = g_param_spec_object ("location",
"Location",
"Location",
GCLUE_TYPE_LOCATION_INFO,
GEOCODE_TYPE_LOCATION,
G_PARAM_READABLE);
g_object_class_install_property (object_class,
PROP_LOCATION,
......@@ -131,19 +131,19 @@ gclue_locator_new (void)
}
static void
gclue_locator_update_location (GClueLocator *locator,
GClueLocationInfo *location)
gclue_locator_update_location (GClueLocator *locator,
GeocodeLocation *location)
{
GClueLocatorPrivate *priv = locator->priv;
if (priv->location == NULL)
priv->location = g_object_new (GCLUE_TYPE_LOCATION_INFO, NULL);
priv->location = g_object_new (GEOCODE_TYPE_LOCATION, NULL);
g_object_set (priv->location,
"latitude", gclue_location_info_get_latitude (location),
"longitude", gclue_location_info_get_longitude (location),
"accuracy", gclue_location_info_get_accuracy (location),
"description", gclue_location_info_get_description (location),
"latitude", geocode_location_get_latitude (location),
"longitude", geocode_location_get_longitude (location),
"accuracy", geocode_location_get_accuracy (location),
"description", geocode_location_get_description (location),
NULL);
g_object_notify (G_OBJECT (locator), "location");
......@@ -156,7 +156,7 @@ on_ipclient_search_ready (GObject *source_object,
{
GClueIpclient *ipclient = GCLUE_IPCLIENT (source_object);
GClueLocator *locator = GCLUE_LOCATOR (user_data);
GClueLocationInfo *location;
GeocodeLocation *location;
GError *error = NULL;
location = gclue_ipclient_search_finish (ipclient, res, &error);
......@@ -300,7 +300,7 @@ gclue_locator_stop_finish (GClueLocator *locator,
return TRUE;
}
GClueLocationInfo * gclue_locator_get_location (GClueLocator *locator)
GeocodeLocation * gclue_locator_get_location (GClueLocator *locator)
{
g_return_val_if_fail (GCLUE_IS_LOCATOR (locator), NULL);
......
......@@ -24,7 +24,7 @@
#define GCLUE_LOCATOR_H
#include <gio/gio.h>
#include "gclue-location-info.h"
#include "geocode-location.h"
G_BEGIN_DECLS
......@@ -70,7 +70,7 @@ void gclue_locator_stop (GClueLocator *locator,
gboolean gclue_locator_stop_finish (GClueLocator *locator,
GAsyncResult *res,
GError **error);
GClueLocationInfo * gclue_locator_get_location (GClueLocator *locator);