mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 04:31:09 +00:00
printing: Use original names for remote CUPS printers
CUPS uses resource paths in the form of "printers/printer_name" or "classes/class_name" so it is enough to remove the "printers/" or "classes/" prefix and use the string behind it as a name. There was recently introduced a wrong check for the prefix. This commit fixes it in the way it was originally intended.
This commit is contained in:
parent
1dcd916c7e
commit
963e5dd0c8
@ -3194,8 +3194,8 @@ avahi_service_resolver_cb (GObject *source_object,
|
||||
if (data->resource_path != NULL)
|
||||
{
|
||||
if (data->got_printer_type &&
|
||||
(g_strcmp0 (data->resource_path, "printers/") == 0 ||
|
||||
g_strcmp0 (data->resource_path, "classes/") == 0))
|
||||
(g_str_has_prefix (data->resource_path, "printers/") ||
|
||||
g_str_has_prefix (data->resource_path, "classes/")))
|
||||
{
|
||||
/* This is a CUPS printer advertised via Avahi */
|
||||
printer_name = g_strrstr (data->resource_path, "/");
|
||||
|
Loading…
Reference in New Issue
Block a user