After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764780 - Add compatibility code for older cups
Add compatibility code for older cups
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-08 13:20 UTC by Felipe Borges
Modified: 2016-04-08 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add compatibility code for older cups (1.92 KB, patch)
2016-04-08 13:20 UTC, Felipe Borges
none Details | Review
Add compatibility code for older cups (1.80 KB, patch)
2016-04-08 14:04 UTC, Felipe Borges
committed Details | Review

Description Felipe Borges 2016-04-08 13:20:31 UTC
Created attachment 325588 [details] [review]
Add compatibility code for older cups

Hiroshi Takekawa sent this patch by email to gnomecc-list@gnome.org

> I'm rebuilding gnome suite since 3.20 has been released, and found
> gnome-control-center cannot be built with older cups.
>
> Probably older cups become unsupported and you're not interested in this
> patch.  Though I created this patch for me anyway, so I'm trying to send
> this for merge.
Comment 1 Marek Kašík 2016-04-08 13:53:50 UTC
Review of attachment 325588 [details] [review]:

Thank you for attaching the patch. It needs some tuning yet.

::: panels/printers/pp-cups.c
@@ +29,3 @@
+#define ippGetState(ipp) ipp->state
+#define ippGetStatusCode(ipp) ipp->request.status.status_code
+#define ippGetString(attr, element, language) attr->values[element].string.text

We don't need to have the ippGetState() and ippGetString() macros here.

::: panels/printers/pp-job.c
@@ +23,3 @@
 #include <gio/gio.h>
 #include <cups/cups.h>
 

We have to add this here:

#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
#define HAVE_CUPS_1_6 1
#endif

Otherwise it won't compile with current CUPS.

@@ +29,3 @@
+#define ippGetInteger(attr, element) attr->values[element].integer
+#define ippGetState(ipp) ipp->state
+#define ippGetStatusCode(ipp) ipp->request.status.status_code

We don't need to have the ippGetState() and ippGetStatusCode() macros here.
Comment 2 Felipe Borges 2016-04-08 14:04:20 UTC
Created attachment 325590 [details] [review]
Add compatibility code for older cups
Comment 3 Marek Kašík 2016-04-08 14:11:57 UTC
Review of attachment 325590 [details] [review]:

Thank you for the changes. It looks good.
Comment 4 Felipe Borges 2016-04-08 14:18:45 UTC
Thanks for the review!




.