diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2022-10-08 18:11:27 +0200 |
---|---|---|
committer | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2022-10-11 14:51:41 +0200 |
commit | c3e232fa260fa57b7217f6a83c90b9eb2c7dfccb (patch) | |
tree | 5706c1b18ce4206f8fc6e787d32467f41672cb7e | |
parent | dc90a358e8410c8f4a631aca2167e2b24f46af9c (diff) | |
download | geoclue-c3e232fa260fa57b7217f6a83c90b9eb2c7dfccb.tar.gz |
Get rid of GClueWebSource parse_response() method
Since it has exactly the same implementation for every derived class.
-rw-r--r-- | src/gclue-3g.c | 13 | ||||
-rw-r--r-- | src/gclue-web-source.c | 3 | ||||
-rw-r--r-- | src/gclue-web-source.h | 3 | ||||
-rw-r--r-- | src/gclue-wifi.c | 13 |
4 files changed, 2 insertions, 30 deletions
diff --git a/src/gclue-3g.c b/src/gclue-3g.c index 29d2746..5f16046 100644 --- a/src/gclue-3g.c +++ b/src/gclue-3g.c @@ -76,10 +76,6 @@ gclue_3g_create_submit_query (GClueWebSource *web, static GClueAccuracyLevel gclue_3g_get_available_accuracy_level (GClueWebSource *web, gboolean available); -static GClueLocation * -gclue_3g_parse_response (GClueWebSource *web, - const char *xml, - GError **error); static void on_3g_enabled (GObject *source_object, @@ -119,14 +115,6 @@ on_is_3g_available_notify (GObject *gobject, source); } -static GClueLocation * -gclue_3g_parse_response (GClueWebSource *web, - const char *content, - GError **error) -{ - return gclue_mozilla_parse_response (content, error); -} - static void cancel_location_3gpp_timeout (GClue3G *g3g) { GClue3GPrivate *priv = g3g->priv; @@ -172,7 +160,6 @@ gclue_3g_class_init (GClue3GClass *klass) source_class->stop = gclue_3g_stop; web_class->create_query = gclue_3g_create_query; web_class->create_submit_query = gclue_3g_create_submit_query; - web_class->parse_response = gclue_3g_parse_response; web_class->get_available_accuracy_level = gclue_3g_get_available_accuracy_level; } diff --git a/src/gclue-web-source.c b/src/gclue-web-source.c index fb09f4b..0ce132b 100644 --- a/src/gclue-web-source.c +++ b/src/gclue-web-source.c @@ -27,6 +27,7 @@ #include "gclue-web-source.h" #include "gclue-error.h" #include "gclue-location.h" +#include "gclue-mozilla.h" /** * SECTION:gclue-web-source @@ -152,7 +153,7 @@ refresh_callback (SoupSession *session, uri = soup_message_get_uri (query); str = soup_uri_to_string (uri, FALSE); g_debug ("Got following response from '%s':\n%s", str, contents); - location = GCLUE_WEB_SOURCE_GET_CLASS (web)->parse_response (web, contents, &local_error); + location = gclue_mozilla_parse_response (contents, &local_error); if (local_error != NULL) { g_task_return_error (task, g_steal_pointer (&local_error)); return; diff --git a/src/gclue-web-source.h b/src/gclue-web-source.h index ea8ea73..aa86e85 100644 --- a/src/gclue-web-source.h +++ b/src/gclue-web-source.h @@ -75,9 +75,6 @@ struct _GClueWebSourceClass { SoupMessage * (*create_submit_query) (GClueWebSource *source, GClueLocation *location, GError **error); - GClueLocation * (*parse_response) (GClueWebSource *source, - const char *response, - GError **error); GClueAccuracyLevel (*get_available_accuracy_level) (GClueWebSource *source, gboolean network_available); diff --git a/src/gclue-wifi.c b/src/gclue-wifi.c index ac7544a..5a1051b 100644 --- a/src/gclue-wifi.c +++ b/src/gclue-wifi.c @@ -167,10 +167,6 @@ static SoupMessage * gclue_wifi_create_submit_query (GClueWebSource *source, GClueLocation *location, GError **error); -static GClueLocation * -gclue_wifi_parse_response (GClueWebSource *source, - const char *json, - GError **error); static GClueAccuracyLevel gclue_wifi_get_available_accuracy_level (GClueWebSource *source, gboolean net_available); @@ -228,7 +224,6 @@ gclue_wifi_class_init (GClueWifiClass *klass) web_class->refresh_finish = gclue_wifi_refresh_finish; web_class->create_submit_query = gclue_wifi_create_submit_query; web_class->create_query = gclue_wifi_create_query; - web_class->parse_response = gclue_wifi_parse_response; web_class->get_available_accuracy_level = gclue_wifi_get_available_accuracy_level; gwifi_class->finalize = gclue_wifi_finalize; @@ -1145,14 +1140,6 @@ create_query: return msg; } -static GClueLocation * -gclue_wifi_parse_response (GClueWebSource *source, - const char *json, - GError **error) -{ - return gclue_mozilla_parse_response (json, error); -} - static SoupMessage * gclue_wifi_create_submit_query (GClueWebSource *source, GClueLocation *location, |