diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-07-04 11:20:33 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-07-04 11:28:10 +0200 |
commit | 23cfdf850bd273df2ed51034a05cfa07dcc514e9 (patch) | |
tree | fa65d2445edf695be23800ef1b7274bc84450e0d | |
parent | 55b72e77fbe7889aeb706dd5b387672c5a8a9715 (diff) | |
download | grilo-23cfdf850bd273df2ed51034a05cfa07dcc514e9.tar.gz |
net: Remove direct libsoup dep from mock backend
The mock backend just manipulates URIs, so require a newer version of
GLib and use GUri to parse those instead of SoupURI.
-rw-r--r-- | libs/net/grl-net-mock.c | 18 | ||||
-rw-r--r-- | meson.build | 2 |
2 files changed, 13 insertions, 7 deletions
diff --git a/libs/net/grl-net-mock.c b/libs/net/grl-net-mock.c index 0aebceb..52a5ca2 100644 --- a/libs/net/grl-net-mock.c +++ b/libs/net/grl-net-mock.c @@ -28,7 +28,6 @@ #include <glib/gi18n-lib.h> #include <glib/gstdio.h> #include <gio/gio.h> -#include <libsoup/soup.h> #include <string.h> #define _GRILO_H_INSIDE_ @@ -61,15 +60,22 @@ get_url_mocked (GrlNetWc *self, char *new_url; if (ignored_parameters) { - SoupURI *uri = soup_uri_new (url); - const char *query = soup_uri_get_query (uri); + g_autoptr(GUri) uri = g_uri_parse (url, G_URI_FLAGS_PARSE_RELAXED, NULL); + const char *query = g_uri_get_query (uri); if (query) { + g_autoptr(GUri) nuri = NULL; char *new_query = g_regex_replace (ignored_parameters, query, -1, 0, "", 0, NULL); - soup_uri_set_query (uri, *new_query ? new_query : NULL); - new_url = soup_uri_to_string (uri, FALSE); - soup_uri_free (uri); + nuri = g_uri_build (G_URI_FLAGS_NONE, + g_uri_get_scheme (uri), + NULL, + g_uri_get_host (uri), + g_uri_get_port (uri), + g_uri_get_path (uri), + *new_query ? new_query : NULL, + g_uri_get_fragment (uri)); + new_url = g_uri_to_string_partial (nuri, G_URI_FLAGS_NONE); g_free (new_query); } else { new_url = g_strdup (url); diff --git a/meson.build b/meson.build index 263ed81..0aabae7 100644 --- a/meson.build +++ b/meson.build @@ -37,7 +37,7 @@ grlpls_lt_version = '@0@.@1@.@2@'.format(soversion, current, grlpls_interface_ag grl_majorminor = '@0@.@1@'.format(version_array[0], version_array[1]) grl_name = '@0@-@1@'.format(meson.project_name(), grl_majorminor) -glib2_required = '2.58' +glib2_required = '2.66' glib2_required_info = '>= @0@'.format(glib2_required) gio_dep = dependency('gio-2.0', version: glib2_required_info, required: true) |