- Reworked correction of hostname of printer which is the

- print job sent to.
- Resolves: #248245, #449379
This commit is contained in:
mkasik 2008-06-12 10:07:53 +00:00
parent a072eb8855
commit dd5db6597d
2 changed files with 54 additions and 1 deletions

View File

@ -16,7 +16,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk2
Version: %{base_version}
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
Source: http://download.gnome.org/sources/gtk+/2.13/gtk+-%{version}.tar.bz2
@ -34,6 +34,10 @@ Patch2: workaround.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=488119
Patch3: system-log-crash.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=248245
# https://bugzilla.redhat.com/show_bug.cgi?id=449379
Patch4: printer-hostname.patch
BuildRequires: atk-devel >= %{atk_version}
BuildRequires: pango-devel >= %{pango_version}
BuildRequires: glib2-devel >= %{glib2_version}
@ -119,6 +123,7 @@ docs for the GTK+ widget toolkit.
%patch1 -p1 -b .set-invisible-char-to-bullet
%patch2 -p1 -b .workaround
%patch3 -p1 -b .system-log-crash
%patch4 -p0 -b .printer-hostname
for i in config.guess config.sub ; do
test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@ -302,6 +307,11 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gtk-2.0
%changelog
* Wed Jun 11 2008 - Marek Kasik <mkasik@redhat.com> - 2.13.2-2
- Reworked correction of hostname of printer which is the
- print job sent to.
- Resolves: #248245, #449379
* Tue Jun 3 2008 Matthias Clasen <mclasen@redhat.com> - 2.13.2-1
- Update to 2.13.2, drop upstreamed patches

43
printer-hostname.patch Normal file
View File

@ -0,0 +1,43 @@
--- modules/printbackends/cups/gtkprintbackendcups.c 2008-06-03 23:23:22.000000000 +0200
+++ modules/printbackends/cups/gtkprintbackendcups.c 2008-06-11 13:15:34.000000000 +0200
@@ -433,6 +433,7 @@ gtk_print_backend_cups_print_stream (Gtk
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));
@@ -444,12 +445,30 @@ gtk_print_backend_cups_print_stream (Gtk
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)