summaryrefslogtreecommitdiffstats
path: root/tdeprint/cups/kmcupsuimanager.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/kmcupsuimanager.cpp
parent6f181849bb63876ad03f8fa156b9fd5310bc9d29 (diff)
downloadtdelibs-9bc0d2cd9d38750658770e69bf0445dc5162beb7.tar.gz
tdelibs-9bc0d2cd9d38750658770e69bf0445dc5162beb7.zip
Update to new CUPS 1.6 API
Diffstat (limited to 'tdeprint/cups/kmcupsuimanager.cpp')
-rw-r--r--tdeprint/cups/kmcupsuimanager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tdeprint/cups/kmcupsuimanager.cpp b/tdeprint/cups/kmcupsuimanager.cpp
index c3dfcb1ac..d0dfe3cdc 100644
--- a/tdeprint/cups/kmcupsuimanager.cpp
+++ b/tdeprint/cups/kmcupsuimanager.cpp
@@ -60,6 +60,8 @@
#include <kaction.h>
#include <kmessagebox.h>
+#include "config.h"
+
KMCupsUiManager::KMCupsUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/)
: KMUiManager(parent,name)
{
@@ -143,6 +145,24 @@ void KMCupsUiManager::setupWizard(KMWizard *wizard)
ipp_attribute_t *attr = req.first();
while (attr)
{
+#ifdef HAVE_CUPS_1_6
+ if (ippGetName(attr) && strcmp(ippGetName(attr),"device-uri") == 0)
+ {
+ if (strncmp(ippGetString(attr, 0, NULL),"socket",6) == 0) backend->enableBackend(KMWizard::TCP,true);
+ else if (strncmp(ippGetString(attr, 0, NULL),"parallel",8) == 0) backend->enableBackend(KMWizard::Local,true);
+ else if (strncmp(ippGetString(attr, 0, NULL),"serial",6) == 0) backend->enableBackend(KMWizard::Local,true);
+ else if (strncmp(ippGetString(attr, 0, NULL),"smb",3) == 0) backend->enableBackend(KMWizard::SMB,true);
+ else if (strncmp(ippGetString(attr, 0, NULL),"lpd",3) == 0) backend->enableBackend(KMWizard::LPD,true);
+ else if (strncmp(ippGetString(attr, 0, NULL),"usb",3) == 0) backend->enableBackend(KMWizard::Local,true);
+ else if (strncmp(ippGetString(attr, 0, NULL),"http",4) == 0 || strncmp(ippGetString(attr, 0, NULL),"ipp",3) == 0)
+ {
+ backend->enableBackend(KMWizard::IPP,true);
+ backend->enableBackend(KMWizard::Custom+1,true);
+ }
+ else if (strncmp(ippGetString(attr, 0, NULL),"fax",3) == 0) backend->enableBackend(KMWizard::Custom+2,true);
+ }
+ attr = ippNextAttribute(req.request());
+#else // HAVE_CUPS_1_6
if (attr->name && strcmp(attr->name,"device-uri") == 0)
{
if (strncmp(attr->values[0].string.text,"socket",6) == 0) backend->enableBackend(KMWizard::TCP,true);
@@ -159,6 +179,7 @@ void KMCupsUiManager::setupWizard(KMWizard *wizard)
else if (strncmp(attr->values[0].string.text,"fax",3) == 0) backend->enableBackend(KMWizard::Custom+2,true);
}
attr = attr->next;
+#endif // HAVE_CUPS_1_6
}
backend->enableBackend(KMWizard::Class, true);
backend->enableBackend(KMWizard::Custom+5, true);