summaryrefslogtreecommitdiffstats
path: root/print/libgnomecups/files/patch-23_replace-set-printer-attrs
blob: ded608b1178e755ee8d80e7e181d8c647088b139 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff -pruN 0.2.2-1/libgnomecups/gnome-cups-printer.c 0.2.2-1ubuntu5/libgnomecups/gnome-cups-printer.c
--- 0.2.2-1/libgnomecups/gnome-cups-printer.c   2005-09-23 21:52:49.000000000 +0100
+++ libgnomecups/gnome-cups-printer.c   2006-06-27 16:21:38.000000000 +0100
@@ -1237,6 +1244,9 @@ gnome_cups_printer_get_description (Gnom
    
 }
 
+/* Define the CUPS-Add-Modify-Printer, see http://www.cups.org/documentation.php/spec-ipp.html#CUPS_ADD_MODIFY_PRINTER */
+#define CUPS_ADD_MODIFY_PRINTER 0x4003
+
 void
 gnome_cups_printer_set_description (GnomeCupsPrinter *printer,
                    const char *description,
@@ -1252,7 +1262,9 @@ gnome_cups_printer_set_description (Gnom
        return;
    }
 
-   request = gnome_cups_request_new_for_printer (IPP_SET_PRINTER_ATTRIBUTES,
+   /* As read in http://lists.samba.org/archive/samba-technical/2003-February/027044.html 
+   CUPS does not currently support IPP_SET_PRINTER_ATTRIBUTES, so a  is used */
+   request = gnome_cups_request_new_for_printer (CUPS_ADD_MODIFY_PRINTER,
                              printer);
    ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_TEXT,
              "printer-info", NULL, description);
@@ -1283,9 +1295,9 @@ gnome_cups_printer_set_location (GnomeCu
    if (!strcmp (location, printer->details->location)) {
        return;
    }
-
+   /* Same as above (IPP_SET_PRINTER_ATTRIBUTES replaced by CUPS-Add-Modify-Printer ) */
    request = gnome_cups_request_new_for_printer (
-       IPP_SET_PRINTER_ATTRIBUTES, printer);
+       CUPS_ADD_MODIFY_PRINTER, printer);
    ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_TEXT,
        "printer-location", NULL, location);
    response = gnome_cups_request_execute (request, NULL, "/admin/", error);