summaryrefslogtreecommitdiff
path: root/modules/printbackends
diff options
context:
space:
mode:
authorMarek Kasik <mkasik@redhat.com>2020-08-20 13:40:04 +0200
committerMarek Kasik <mkasik@redhat.com>2020-08-20 13:54:02 +0200
commit5a8f90357d75244816d4cbe6325eab8775322890 (patch)
tree991d9350b6c14d4b52056d272c11118d88ae6a60 /modules/printbackends
parent2031bcd38861bc13a101f0c3fc295ed36a5cc96e (diff)
downloadgtk+-5a8f90357d75244816d4cbe6325eab8775322890.tar.gz
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.
Diffstat (limited to 'modules/printbackends')
-rw-r--r--modules/printbackends/gtkprintbackendcups.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/printbackends/gtkprintbackendcups.c b/modules/printbackends/gtkprintbackendcups.c
index b168d34368..c3ba93e639 100644
--- a/modules/printbackends/gtkprintbackendcups.c
+++ b/modules/printbackends/gtkprintbackendcups.c
@@ -3171,8 +3171,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, "/");