Commit b1ee090c authored by Jussi Kukkonen's avatar Jussi Kukkonen

Change plazes position provider to use new WebService-class

parent 09eca2a7
...@@ -4,3 +4,6 @@ all: geoclue_web_service.o ...@@ -4,3 +4,6 @@ all: geoclue_web_service.o
geoclue_web_service.o: geoclue_web_service.c geoclue_web_service.o: geoclue_web_service.c
$(CC) $(geoclue_web_service_CFLAGS) -c geoclue_web_service.c $(CC) $(geoclue_web_service_CFLAGS) -c geoclue_web_service.c
clean:
rm geoclue_web_service.o
...@@ -68,7 +68,7 @@ static void geoclue_web_service_connection_events_init (GeoclueWebService *self) ...@@ -68,7 +68,7 @@ static void geoclue_web_service_connection_events_init (GeoclueWebService *self)
G_CALLBACK(geoclue_web_service_conic_callback), G_CALLBACK(geoclue_web_service_conic_callback),
self); self);
self->using_connection_events = TRUE; self->using_connection_events = TRUE;
g_debug ("Internet connection event monitoring started"); g_debug ("connection_events init");
} }
static void geoclue_web_service_connection_events_deinit (GeoclueWebService *self) static void geoclue_web_service_connection_events_deinit (GeoclueWebService *self)
...@@ -133,7 +133,7 @@ geoclue_web_service_fetch (GeoclueWebService *self, gchar *url) ...@@ -133,7 +133,7 @@ geoclue_web_service_fetch (GeoclueWebService *self, gchar *url)
g_assert (url); g_assert (url);
xmlNanoHTTPInit(); xmlNanoHTTPInit();
g_debug ("GET DATA: %s", url); g_debug ("fetch: %s", url);
ctxt = xmlNanoHTTPMethod (url, "GET", NULL, NULL, NULL, 0); ctxt = xmlNanoHTTPMethod (url, "GET", NULL, NULL, NULL, 0);
if (!ctxt) { if (!ctxt) {
g_debug ("xmlNanoHTTPMethod did not get a response."); g_debug ("xmlNanoHTTPMethod did not get a response.");
...@@ -348,7 +348,6 @@ geoclue_web_service_query (GeoclueWebService *self, ...) ...@@ -348,7 +348,6 @@ geoclue_web_service_query (GeoclueWebService *self, ...)
gchar *key, *value, *esc_value, *tmp, *url; gchar *key, *value, *esc_value, *tmp, *url;
gboolean first_pair = TRUE; gboolean first_pair = TRUE;
g_debug ("get_data");
g_return_val_if_fail (GEOCLUE_IS_WEB_SERVICE (self), FALSE); g_return_val_if_fail (GEOCLUE_IS_WEB_SERVICE (self), FALSE);
g_return_val_if_fail (self->base_url, FALSE); g_return_val_if_fail (self->base_url, FALSE);
......
...@@ -11,7 +11,7 @@ geoclue_position_server_plazes_SOURCES = geoclue_position_server_plazes.c \ ...@@ -11,7 +11,7 @@ geoclue_position_server_plazes_SOURCES = geoclue_position_server_plazes.c \
# TODO: Yahoo libs/cflags is wrong, fix these... # TODO: Yahoo libs/cflags is wrong, fix these...
AM_CPPFLAGS = $(YAHOO_CFLAGS) $(CONIC_CFLAGS) -I$(top_srcdir) AM_CPPFLAGS = $(YAHOO_CFLAGS) $(CONIC_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(YAHOO_LIBS) $(CONIC_LIBS) ../../geoclue/libgeoclue.la AM_LDFLAGS = $(YAHOO_LIBS) $(CONIC_LIBS) ../../geoclue/libgeoclue.la ../common/geoclue_web_service.o
EXTRA_DIST = geoclue_position_server_plazes.h \ EXTRA_DIST = geoclue_position_server_plazes.h \
position_plazes.desc \ position_plazes.desc \
......
...@@ -19,19 +19,14 @@ ...@@ -19,19 +19,14 @@
#ifndef __GEOCLUE_POSITION_SERVER_H__ #ifndef __GEOCLUE_POSITION_SERVER_H__
#define __GEOCLUE_POSITION_SERVER_H__ #define __GEOCLUE_POSITION_SERVER_H__
#define DBUS_API_SUBJECT_TO_CHANGE
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <glib.h> #include <glib.h>
#ifdef HAVE_LIBCONIC #include "../common/geoclue_web_service.h"
#include <conicconnection.h>
#endif
#define GEOCLUE_POSITION_DBUS_SERVICE "org.freedesktop.geoclue.position.plazes" #define GEOCLUE_POSITION_DBUS_SERVICE "org.freedesktop.geoclue.position.plazes"
#define GEOCLUE_POSITION_DBUS_PATH "/org/freedesktop/geoclue/position/plazes" #define GEOCLUE_POSITION_DBUS_PATH "/org/freedesktop/geoclue/position/plazes"
...@@ -49,9 +44,12 @@ struct GeocluePosition ...@@ -49,9 +44,12 @@ struct GeocluePosition
GObject parent; GObject parent;
GMainLoop* loop; GMainLoop* loop;
GeoclueWebService *web_service;
gdouble current_lat; gdouble current_lat;
gdouble current_lon; gdouble current_lon;
gboolean is_current_valid; gboolean is_current_valid;
gboolean is_civic_valid;
gchar* civic_country; gchar* civic_country;
gchar* civic_region; gchar* civic_region;
...@@ -64,12 +62,6 @@ struct GeocluePosition ...@@ -64,12 +62,6 @@ struct GeocluePosition
gchar* civic_room; gchar* civic_room;
gchar* civic_description; gchar* civic_description;
gchar* civic_text; gchar* civic_text;
gboolean is_civic_valid;
#ifdef HAVE_LIBCONIC
ConIcConnection* net_connection;
DBusConnection* dbus_connection;
#endif
}; };
struct GeocluePositionClass struct GeocluePositionClass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment