+2008-06-12 Matthias Clasen <mclasen@redhat.com>
+
+ RH bug 248245 and 449379: cups client printing from gnome
+ applications fail
+
+ * modules/printbackends/cups/gtkprintbackendcups.c: Really fix
+ printer URI construction. Patch by Marek Kasik
+
2008-06-12 Michael Natterer <mitch@imendio.com>
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
GtkCupsRequest *request;
GtkPrintSettings *settings;
const gchar *title;
+ char printer_absolute_uri[HTTP_MAX_URI];
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
GTK_CUPS_POST,
IPP_PRINT_JOB,
data_io,
- cups_printer->hostname,
+ NULL,
cups_printer->device_uri);
+#if (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2) || CUPS_VERSION_MAJOR > 1
+ httpAssembleURIf (HTTP_URI_CODING_ALL,
+ printer_absolute_uri,
+ sizeof (printer_absolute_uri),
+ "ipp",
+ NULL,
+ "localhost",
+ ippPort (),
+ "/printers/%s",
+ gtk_printer_get_name (gtk_print_job_get_printer (job)));
+#else
+ g_snprintf (printer_absolute_uri,
+ sizeof (printer_absolute_uri),
+ "ipp://localhost:%d/printers/%s",
+ ippPort (),
+ gtk_printer_get_name (gtk_print_job_get_printer (job)));
+#endif
+
gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION,
IPP_TAG_URI, "printer-uri",
- NULL, cups_printer->printer_uri);
+ NULL, printer_absolute_uri);
title = gtk_print_job_get_title (job);
if (title)