summaryrefslogtreecommitdiffstats
path: root/tdeprint/cups/kmwippselect.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-10 16:51:25 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-08-10 16:51:25 -0500
commit9bc0d2cd9d38750658770e69bf0445dc5162beb7 (patch)
tree64d13ba540404b0dc3a05d3dccc68006ab42c4b0 /tdeprint/cups/kmwippselect.cpp
parent6f181849bb63876ad03f8fa156b9fd5310bc9d29 (diff)
downloadtdelibs-9bc0d2cd9d38750658770e69bf0445dc5162beb7.tar.gz
tdelibs-9bc0d2cd9d38750658770e69bf0445dc5162beb7.zip
Update to new CUPS 1.6 API
Diffstat (limited to 'tdeprint/cups/kmwippselect.cpp')
-rw-r--r--tdeprint/cups/kmwippselect.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tdeprint/cups/kmwippselect.cpp b/tdeprint/cups/kmwippselect.cpp
index b5e6c0405..a10a14ba5 100644
--- a/tdeprint/cups/kmwippselect.cpp
+++ b/tdeprint/cups/kmwippselect.cpp
@@ -29,6 +29,8 @@
#include <kdebug.h>
#include <kiconloader.h>
+#include "config.h"
+
KMWIppSelect::KMWIppSelect(TQWidget *parent, const char *name)
: KMWizardPage(parent,name)
{
@@ -83,9 +85,15 @@ void KMWIppSelect::initPrinter(KMPrinter *p)
ipp_attribute_t *attr = req.first();
while (attr)
{
+#ifdef HAVE_CUPS_1_6
+ if (ippGetName(attr) && strcmp(ippGetName(attr),"printer-name") == 0)
+ m_list->insertItem(SmallIcon("tdeprint_printer"),TQString::fromLatin1(ippGetString(attr, 0, NULL)));
+ attr = ippNextAttribute(req.request());
+#else // HAVE_CUPS_1_6
if (attr->name && strcmp(attr->name,"printer-name") == 0)
m_list->insertItem(SmallIcon("tdeprint_printer"),TQString::fromLatin1(attr->values[0].string.text));
attr = attr->next;
+#endif // HAVE_CUPS_1_6
}
m_list->sort();
}