projects
/
azimuth
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c34b1ff
)
Add GPS controller. Not enabled yet
author
Alban Crequy
<alban.crequy@collabora.co.uk>
Mon, 3 May 2010 15:41:58 +0000
(16:41 +0100)
committer
Alban Crequy
<alban.crequy@collabora.co.uk>
Mon, 3 May 2010 15:41:58 +0000
(16:41 +0100)
src/position-publisher.c
patch
|
blob
|
history
diff --git
a/src/position-publisher.c
b/src/position-publisher.c
index
9f2f0a1
..
c6351c0
100644
(file)
--- a/
src/position-publisher.c
+++ b/
src/position-publisher.c
@@
-26,6
+26,7
@@
#include <telepathy-glib/interfaces.h>
#include <location/location-gps-device.h>
#include <telepathy-glib/interfaces.h>
#include <location/location-gps-device.h>
+#include <location/location-gpsd-control.h>
#include "connection-watcher.h"
#include "position-publisher.h"
#include "connection-watcher.h"
#include "position-publisher.h"
@@
-41,6
+42,7
@@
typedef struct _PositionPublisherPrivate PositionPublisherPrivate;
struct _PositionPublisherPrivate
{
ConnectionWatcher *watcher;
struct _PositionPublisherPrivate
{
ConnectionWatcher *watcher;
+ LocationGPSDControl *gps_control;
LocationGPSDevice *gps_device;
GSList *connections;
GHashTable *location;
LocationGPSDevice *gps_device;
GSList *connections;
GHashTable *location;
@@
-241,6
+243,13
@@
position_publisher_init (PositionPublisher *obj)
g_signal_connect (priv->watcher, "connection-added",
G_CALLBACK (connection_added_cb), obj);
g_signal_connect (priv->watcher, "connection-added",
G_CALLBACK (connection_added_cb), obj);
+ priv->gps_control = location_gpsd_control_get_default();
+
+ g_object_set (G_OBJECT(priv->gps_control),
+ "preferred-method", LOCATION_METHOD_USER_SELECTED,
+ "preferred-interval", LOCATION_INTERVAL_120S,
+ NULL);
+
priv->gps_device = g_object_new (LOCATION_TYPE_GPS_DEVICE, NULL);
g_signal_connect (priv->gps_device, "changed",
priv->gps_device = g_object_new (LOCATION_TYPE_GPS_DEVICE, NULL);
g_signal_connect (priv->gps_device, "changed",
@@
-290,6
+299,7
@@
position_publisher_dispose (GObject *object)
priv->dispose_has_run = TRUE;
g_object_unref (priv->watcher);
priv->dispose_has_run = TRUE;
g_object_unref (priv->watcher);
+ g_object_unref (priv->gps_control);
g_object_unref (priv->gps_device);
for (l = priv->connections; l != NULL; l = g_slist_next (l))
g_object_unref (priv->gps_device);
for (l = priv->connections; l != NULL; l = g_slist_next (l))