[gtk+/gtk-3-4] Bug 670373: modules/printing/cups/gtkprintbackendcups.c won't build with CUPS 1.6
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-4] Bug 670373: modules/printing/cups/gtkprintbackendcups.c won't build with CUPS 1.6
- Date: Mon, 23 Apr 2012 21:38:33 +0000 (UTC)
commit 4b3d566de1987531cefa731d8f6e7bd71f2ac997
Author: John Ralls <jralls ceridwen us>
Date: Sun Feb 19 13:48:19 2012 -0800
Bug 670373: modules/printing/cups/gtkprintbackendcups.c won't build with CUPS 1.6
Having refactored cups_request_printer_list_cb so that the cups
version-dependent block size is small enough to be handled in a single ifdef,
make the ifdef HAVE_CUPS_API_1_6 block.
modules/printbackends/cups/gtkprintbackendcups.c | 24 +++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 5d4e2af..af34eef 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2000,7 +2000,29 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
removed_printer_checklist = gtk_print_backend_get_printer_list (backend);
response = gtk_cups_result_get_response (result);
+#ifdef HAVE_CUPS_API_1_6
+ for (attr = ippFirstAttribute (response); attr != NULL;
+ attr = ippNextAttribute (response))
+ {
+ GtkPrinter *printer;
+ gboolean status_changed = FALSE;
+ GList *node;
+ gint i;
+ PrinterSetupInfo *info = g_slice_new0 (PrinterSetupInfo);
+
+ /* Skip leading attributes until we hit a printer...
+ */
+ while (attr != NULL && ippGetGroupTag (attr) != IPP_TAG_PRINTER)
+ attr = ippNextAttribute (response);
+ if (attr == NULL)
+ break;
+ while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_PRINTER)
+ {
+ cups_printer_handle_attribute (cups_backend, attr, info);
+ attr = ippNextAttribute (response);
+ }
+#else
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
GtkPrinter *printer;
@@ -2016,12 +2038,12 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
if (attr == NULL)
break;
-
while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_PRINTER)
{
cups_printer_handle_attribute (cups_backend, attr, info);
attr = attr->next;
}
+#endif
if (info->printer_name == NULL ||
(info->printer_uri == NULL && info->member_uris == NULL))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]