Port to libsoup3

This commit is contained in:
Milan Crha
2022-06-22 08:51:30 -03:00
committed by Georges Basile Stavracas Neto
parent 0fa383a14a
commit 0bd11799dc
10 changed files with 161 additions and 140 deletions
@@ -166,19 +166,13 @@ setup_calendar (GcalEditCalendarPage *self,
/* If it's remote, build the uri */
if (is_remote)
{
ESourceAuthentication *auth;
g_autoptr (SoupURI) soup = NULL;
g_autoptr (GUri) guri = NULL;
g_autofree gchar *uri = NULL;
ESourceWebdav *webdav;
auth = e_source_get_extension (source, E_SOURCE_EXTENSION_AUTHENTICATION);
webdav = e_source_get_extension (source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
soup = e_source_webdav_dup_soup_uri (webdav);
uri = g_strdup_printf ("%s://%s:%d%s",
soup_uri_get_scheme (soup),
e_source_authentication_get_host (auth),
e_source_authentication_get_port (auth),
e_source_webdav_get_resource_path (webdav));
guri = e_source_webdav_dup_uri (webdav);
uri = g_uri_to_string_partial (guri, G_URI_HIDE_PASSWORD);
gtk_link_button_set_uri (GTK_LINK_BUTTON (self->calendar_url_button), uri);
gtk_button_set_label (GTK_BUTTON (self->calendar_url_button), uri);
@@ -345,15 +345,15 @@ static gboolean
validate_url_cb (gpointer data)
{
GcalNewCalendarPage *self = data;
g_autoptr (SoupURI) uri = NULL;
g_autoptr (GUri) guri = NULL;
GCAL_ENTRY;
self->validate_url_resource_id = 0;
uri = soup_uri_new (gtk_editable_get_text (GTK_EDITABLE (self->calendar_address_entry)));
guri = g_uri_parse (gtk_editable_get_text (GTK_EDITABLE (self->calendar_address_entry)), SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
if (uri != NULL && SOUP_URI_IS_VALID (uri))
if (guri != NULL && g_uri_get_scheme (guri) && g_uri_get_host (guri))
{
discover_sources (self);
}
+3 -3
View File
@@ -430,14 +430,14 @@ add_meeting (GcalEventPopover *self,
static void
setup_location_label (GcalEventPopover *self)
{
g_autoptr (SoupURI) soup_uri = NULL;
g_autoptr (GUri) guri = NULL;
g_autofree gchar *location = NULL;
location = g_strdup (gcal_event_get_location (self->event));
g_strstrip (location);
soup_uri = soup_uri_new (location);
if (soup_uri)
guri = g_uri_parse (location, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED, NULL);
if (guri)
{
GString *string;