#3 Add patch to fix parsing of addresses while adding printers
Merged 4 years ago by kalev. Opened 4 years ago by feborges.
rpms/ feborges/gnome-control-center f31  into  f31

file modified
+7 -1
@@ -10,7 +10,7 @@ 

  

  Name:           gnome-control-center

  Version:        3.34.1

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        Utilities to configure the GNOME desktop

  

  License:        GPLv2+ and CC-BY-SA
@@ -23,6 +23,9 @@ 

  # https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/586

  Patch1:         0001-region-Explicitly-update-LC_-even-when-matching-LANG.patch

  

+ # https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/587

+ Patch2:         printers-provide-scheme-to-address-parser.patch

+ 

  BuildRequires:  chrpath

  BuildRequires:  cups-devel

  BuildRequires:  desktop-file-utils
@@ -192,6 +195,9 @@ 

  %dir %{_datadir}/gnome/wm-properties

  

  %changelog

+ * Wed Oct 09 2019 Felipe Borges <feborges@redhat.com> - 3.34.1-3

+ - Add patch to fix parsing of addresses while adding printers (rhbz#1750394)

+ 

  * Mon Oct 07 2019 Benjamin Berg <bberg@redhat.com> - 3.34.1-2

  - Add patch to fix resetting of system wide format locale (rhbz#1759221)

  

@@ -0,0 +1,106 @@ 

+ From 8f169336e681a4dc5e7f9ded5e5ac46aaa001157 Mon Sep 17 00:00:00 2001

+ From: Marek Kasik <mkasik@redhat.com>

+ Date: Tue, 8 Oct 2019 18:04:30 +0200

+ Subject: [PATCH] printers: Provide a scheme to address parser

+ 

+ Add a scheme to the address which we test for correctness

+ by g_network_address_parse_uri(). It does not work without it.

+ Use "none" scheme if user did not entered one.

+ Use port number 0 if user did not specify any.

+ 

+ Fixes #679

+ ---

+  panels/printers/pp-new-printer-dialog.c | 66 +++++++++++++++----------

+  1 file changed, 40 insertions(+), 26 deletions(-)

+ 

+ diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c

+ index 651c0d8f3..81a4cc1f6 100644

+ --- a/panels/printers/pp-new-printer-dialog.c

+ +++ b/panels/printers/pp-new-printer-dialog.c

+ @@ -1607,43 +1607,57 @@ search_address (const gchar        *text,

+  

+        if (text && text[0] != '\0')

+          {

+ -          g_autoptr(GSocketConnectable) conn;

+ +          g_autoptr(GSocketConnectable) conn = NULL;

+ +          g_autofree gchar *test_uri = NULL;

+ +          g_autofree gchar *test_port = NULL;

+            gchar *scheme = NULL;

+            gchar *host = NULL;

+            gint   port;

+  

+            parse_uri (text, &scheme, &host, &port);

+  

+ -          conn = g_network_address_parse_uri (host, port, NULL);

+ -

+ -          if (host != NULL && conn != NULL)

+ +          if (host != NULL)

+              {

+ -              THostSearchData *search_data;

+ +              if (port >= 0)

+ +                test_port = g_strdup_printf (":%d", port);

+ +              else

+ +                test_port = g_strdup ("");

+  

+ -              search_data = g_new (THostSearchData, 1);

+ -              search_data->host_scheme = scheme;

+ -              search_data->host_name = host;

+ -              search_data->host_port = port;

+ -              search_data->dialog = self;

+ +              test_uri = g_strdup_printf ("%s://%s%s",

+ +                                          scheme != NULL && scheme[0] != '\0' ? scheme : "none",

+ +                                          host,

+ +                                          test_port);

+  

+ -              if (self->host_search_timeout_id != 0)

+ +              conn = g_network_address_parse_uri (test_uri, 0, NULL);

+ +              if (conn != NULL)

+                  {

+ -                  g_source_remove (self->host_search_timeout_id);

+ -                  self->host_search_timeout_id = 0;

+ -                }

+ +                  THostSearchData *search_data;

+  

+ -              if (delay_search)

+ -                {

+ -                  self->host_search_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,

+ -                                                                     HOST_SEARCH_DELAY,

+ -                                                                     (GSourceFunc) search_for_remote_printers,

+ -                                                                     search_data,

+ -                                                                     (GDestroyNotify) search_for_remote_printers_free);

+ -                }

+ -              else

+ -                {

+ -                  search_for_remote_printers (search_data);

+ -                  search_for_remote_printers_free (search_data);

+ +                  search_data = g_new (THostSearchData, 1);

+ +                  search_data->host_scheme = scheme;

+ +                  search_data->host_name = host;

+ +                  search_data->host_port = port;

+ +                  search_data->dialog = self;

+ +

+ +                  if (self->host_search_timeout_id != 0)

+ +                    {

+ +                      g_source_remove (self->host_search_timeout_id);

+ +                      self->host_search_timeout_id = 0;

+ +                    }

+ +

+ +                  if (delay_search)

+ +                    {

+ +                      self->host_search_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,

+ +                                                                         HOST_SEARCH_DELAY,

+ +                                                                         (GSourceFunc) search_for_remote_printers,

+ +                                                                         search_data,

+ +                                                                         (GDestroyNotify) search_for_remote_printers_free);

+ +                    }

+ +                  else

+ +                    {

+ +                      search_for_remote_printers (search_data);

+ +                      search_for_remote_printers_free (search_data);

+ +                    }

+                  }

+              }

+          }

+ -- 

+ 2.21.0

+ 

This fix was added after the 3.34.1 release. It is important because it restores the functionality of searching for remote printers.

rhbz#1750394

This seems to be missing spec file changes.

rebased onto 5584ce8

4 years ago

Pull-Request has been merged by kalev

4 years ago