Fix some IPP compliance issues. (#391523, Albrecht Dress)

2007-01-01  Matthias Clasen  <mclasen@redhat.com>

        Fix some IPP compliance issues.  (#391523, Albrecht Dress)

        * modules/printbackends/cups/gtkcupsutils.c
        (gtk_cups_request_encode_option): Use IPP_TAG_JOB, not
        IPP_TAG_OPERATION.
        * modules/printbackends/cups/gtkprintbackendcups.c
        (gtk_print_backend_cups_print_stream): Don't add the
        requesting-user-name attribute a second time.



svn path=/trunk/; revision=17002
This commit is contained in:
Matthias Clasen 2007-01-01 23:47:45 +00:00 committed by Matthias Clasen
parent 9020751b2a
commit 29282c6ec9
3 changed files with 23 additions and 10 deletions

View File

@ -1,3 +1,14 @@
2007-01-01 Matthias Clasen <mclasen@redhat.com>
Fix some IPP compliance issues. (#391523, Albrecht Dress)
* modules/printbackends/cups/gtkcupsutils.c
(gtk_cups_request_encode_option): Use IPP_TAG_JOB, not
IPP_TAG_OPERATION.
* modules/printbackends/cups/gtkprintbackendcups.c
(gtk_print_backend_cups_print_stream): Don't add the
requesting-user-name attribute a second time.
2007-01-01 Matthias Clasen <mclasen@redhat.com> 2007-01-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkimcontextsimple.c: Fix en/em dash confusion. (#378462) * gtk/gtkimcontextsimple.c: Fix en/em dash confusion. (#378462)

View File

@ -364,10 +364,15 @@ _find_option_tag (const gchar *option)
} }
} }
/*
* Note that this function uses IPP_TAG_JOB, so it is
* only suitable for IPP Group 2 attributes.
* See RFC 2911.
*/
void void
gtk_cups_request_encode_option (GtkCupsRequest *request, gtk_cups_request_encode_option (GtkCupsRequest *request,
const gchar *option, const gchar *option,
const gchar *value) const gchar *value)
{ {
ipp_tag_t option_tag; ipp_tag_t option_tag;
@ -391,7 +396,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
case IPP_TAG_INTEGER: case IPP_TAG_INTEGER:
case IPP_TAG_ENUM: case IPP_TAG_ENUM:
ippAddInteger (request->ipp_request, ippAddInteger (request->ipp_request,
IPP_TAG_OPERATION, IPP_TAG_JOB,
option_tag, option_tag,
option, option,
strtol (value, NULL, 0)); strtol (value, NULL, 0));
@ -407,7 +412,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
b = 1; b = 1;
ippAddBoolean(request->ipp_request, ippAddBoolean(request->ipp_request,
IPP_TAG_OPERATION, IPP_TAG_JOB,
option, option,
b); b);
@ -439,7 +444,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
upper = lower; upper = lower;
ippAddRange (request->ipp_request, ippAddRange (request->ipp_request,
IPP_TAG_OPERATION, IPP_TAG_JOB,
option, option,
lower, lower,
upper); upper);
@ -467,7 +472,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
units = IPP_RES_PER_INCH; units = IPP_RES_PER_INCH;
ippAddResolution (request->ipp_request, ippAddResolution (request->ipp_request,
IPP_TAG_OPERATION, IPP_TAG_JOB,
option, option,
units, units,
xres, xres,
@ -526,7 +531,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
{ {
/* single value */ /* single value */
ippAddString (request->ipp_request, ippAddString (request->ipp_request,
IPP_TAG_OPERATION, IPP_TAG_JOB,
option_tag, option_tag,
option, option,
NULL, NULL,
@ -540,7 +545,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
g_ptr_array_add (strings, next); g_ptr_array_add (strings, next);
ippAddStrings (request->ipp_request, ippAddStrings (request->ipp_request,
IPP_TAG_OPERATION, IPP_TAG_JOB,
option_tag, option_tag,
option, option,
strings->len, strings->len,

View File

@ -422,9 +422,6 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend,
gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, cups_printer->printer_uri); NULL, cups_printer->printer_uri);
gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
title = gtk_print_job_get_title (job); title = gtk_print_job_get_title (job);
if (title) if (title)
gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,