cups-browsed/0001-Do-not-generate-PPD-for-remote-raw-queues-44.patch
2024-10-15 17:31:53 +02:00

45 lines
1.6 KiB
Diff

diff --git a/daemon/cups-browsed.c b/daemon/cups-browsed.c
index 8c5349f..5496970 100644
--- a/daemon/cups-browsed.c
+++ b/daemon/cups-browsed.c
@@ -6736,6 +6736,9 @@ create_remote_printer_entry (const char *queue_name,
p->queue_name, p->uri);
goto fail;
}
+
+ attr = ippFindAttribute(p->prattrs, "printer-make-and-model", IPP_TAG_TEXT);
+ p->make_model = attr ? strdup(ippGetString(attr, 0, NULL)) : NULL;
}
}
else
@@ -7520,7 +7523,7 @@ create_queue(void* arg)
debug_printf("Generated Default Attributes for local queue %s\n",
p->queue_name);
}
- if (ppdfile == NULL)
+ if (ppdfile == NULL && make_model && strcmp(make_model, "Local Raw Printer"))
{
// If we do not want CUPS-generated PPDs or we cannot obtain a
// CUPS-generated PPD, for example if CUPS does not create a
@@ -7712,7 +7715,7 @@ create_queue(void* arg)
debug_printf("Generated Default Attributes for local queue %s\n",
p->queue_name);
}
- if (ppdfile == NULL)
+ if (ppdfile == NULL && make_model && strcmp(make_model, "Local Raw Printer"))
{
// If we do not want CUPS-generated PPDs or we cannot obtain a
// CUPS-generated PPD, for example if CUPS does not create a
@@ -7983,6 +7986,11 @@ create_queue(void* arg)
}
ppdfile = strdup(buf);
}
+ else
+ {
+ // No PPD - define nickname as make_model for remote raw queue
+ p->nickname = p->make_model ? strdup(p->make_model) : strdup("Local Raw Printer");
+ }
// Create a new CUPS queue or modify the existing queue
request = ippNewRequest(CUPS_ADD_MODIFY_PRINTER);