diff options
author | Tim Waugh <twaugh@redhat.com> | 2010-02-16 19:51:43 +0100 |
---|---|---|
committer | Vincent Untz <vuntz@novell.com> | 2010-02-16 19:51:43 +0100 |
commit | cab6ac5851558c9746cee919213c2118ea529903 (patch) | |
tree | 1064b75fc0a4a063ea02ad6ebd8058b6b9aa30e2 | |
parent | 534efdda6a53ee2beaa025e6dc89ea477e4a98e8 (diff) |
Support adding printer without device URI
https://bugzilla.redhat.com/show_bug.cgi?id=526442
Signed-off-by: Vincent Untz <vuntz@novell.com>
-rw-r--r-- | src/cups.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2,8 +2,9 @@ * vim: set et ts=8 sw=8: * * Copyright (C) 2008 Novell, Inc. + * Copyright (C) 2009 Red Hat, Inc. * - * Authors: Vincent Untz + * Authors: Vincent Untz, Tim Waugh * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1405,11 +1406,13 @@ cph_cups_printer_add (CphCups *cups, ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_NAME, "printer-name", NULL, printer_name); - ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_URI, - "device-uri", NULL, printer_uri); ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_NAME, "ppd-name", NULL, ppd_file); + if (printer_uri && printer_uri[0] != '\0') { + ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_URI, + "device-uri", NULL, printer_uri); + } if (info && info[0] != '\0') { ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info", NULL, info); |