From fa41d5a6ae6e409a328284cbb8ef7fedfc784dc6 Mon Sep 17 00:00:00 2001
From: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
Date: Mon, 14 Sep 2026 06:47:18 -0300
Subject: tdeprint: require CUPS 2.0 or newer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Raise the minimum supported CUPS version to 2.0 in the CMake and legacy configure checks.

Remove obsolete CUPS 1.x compatibility branches throughout TDEPrint and keep only the code paths applicable to CUPS 2.x.

Drop HAVE_CUPS, HAVE_CUPS_1_6 and HAVE_CUPS_NO_PWD_CACHE. CUPS availability is enforced at configure time, so these feature macros are no longer needed.

Signed-off-by: Sebastião Guerra <sebastiao.luiz.guerra@gmail.com>
---
 CMakeLists.txt                         |  21 +--
 config.h.cmake                         |   9 --
 tdeprint/configure.in.in               |  14 +-
 tdeprint/cups/cupsdconf2/cups-util.c   |  69 +--------
 tdeprint/cups/cupsdconf2/cupsdconf.cpp |  40 +-----
 tdeprint/cups/ipprequest.cpp           | 251 +--------------------------------
 tdeprint/cups/ipprequest.h             |   7 -
 tdeprint/cups/kmcupsjobmanager.cpp     |  69 ---------
 tdeprint/cups/kmcupsmanager.cpp        |  66 ---------
 tdeprint/cups/kmcupsuimanager.cpp      |  19 ---
 tdeprint/cups/kmwfax.cpp               |   8 --
 tdeprint/cups/kmwipp.cpp               |   4 +-
 tdeprint/cups/kmwippselect.cpp         |   6 -
 13 files changed, 15 insertions(+), 568 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8766284c7..43c8d3c5e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1184,29 +1184,12 @@ endif( WITH_SSL )
 
 
 ##### check for cups ############################
-# FIXME CUPS must be at least 1.1.9
 
 if( WITH_CUPS )
-  find_package( Cups )
+  find_package( Cups 2.0 )
   if( NOT CUPS_FOUND )
-    message(FATAL_ERROR "\nCUPS support are requested, but not found on your system" )
+    message(FATAL_ERROR "\nCUPS support is requested, but CUPS 2.0 or newer was not found on your system" )
   endif( NOT CUPS_FOUND )
-  set( HAVE_CUPS 1 )
-  # FIXME if CUPS is at least 1.1.20, doesn't have password caching
-  set( HAVE_CUPS_NO_PWD_CACHE 1 )
-
-  # save CMAKE_REQUIRED_LIBRARIES
-  set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
-  set( CMAKE_REQUIRED_LIBRARIES ${CUPS_LIBRARIES} )
-  check_c_source_compiles("
-    #include <cups/cups.h>
-    #include <cups/ipp.h>
-    #include <cups/language.h>
-    int main(int argc, char *argv[]) { ipp_attribute_t *attr = 0; ippGetName(attr); return 0; } "
-    HAVE_CUPS_1_6 )
-  # restore CMAKE_REQUIRED_LIBRARIES
-  set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
-  unset( bak_CMAKE_REQUIRED_LIBRARIES )
 endif( WITH_CUPS )
 
 
diff --git a/config.h.cmake b/config.h.cmake
index c5d663b46..c7325c341 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -130,15 +130,6 @@
 /* Define to 1 if you have the <ctype.h> header file. */
 #cmakedefine HAVE_CTYPE_H 1
 
-/* Defines if you have CUPS (Common UNIX Printing System) */
-#cmakedefine HAVE_CUPS 1
-
-/* CUPS doesn't have password caching */
-#cmakedefine HAVE_CUPS_NO_PWD_CACHE 1
-
-/* CUPS is at least version 1.6 */
-#cmakedefine HAVE_CUPS_1_6 1
-
 /* Define to 1 if you have the declaration of `getservbyname_r', and to 0 if you don't. */
 #cmakedefine01 HAVE_DECL_GETSERVBYNAME_R
 
diff --git a/tdeprint/configure.in.in b/tdeprint/configure.in.in
index 3165cc4c4..48b37ccc2 100644
--- a/tdeprint/configure.in.in
+++ b/tdeprint/configure.in.in
@@ -72,19 +72,12 @@ if test "$ac_use_cups" = "yes"; then
       AC_MSG_WARN(CUPS headers not found. CUPS support disabled)
       ac_use_cups="no"
     else
-      dnl check that version is at least 1.1.9
-      AC_CHECK_CUPS_VERSION(1.0109)
+      dnl check that version is at least 2.0
+      AC_CHECK_CUPS_VERSION(2.0)
       if test "$ac_have_new_cups" = "no"; then
-        AC_MSG_WARN(CUPS version too old. You should upgrade to version >= 1.1.9)
+        AC_MSG_WARN(CUPS version too old. You should upgrade to version >= 2.0)
 	ac_use_cups="no"
       fi
-
-      dnl check if CUPS is at least 1.1.20
-      ac_have_new_cups="no"
-      AC_CHECK_CUPS_VERSION(1.0120)
-      if test "$ac_have_new_cups" = "yes"; then
- 	AC_DEFINE(HAVE_CUPS_NO_PWD_CACHE, 1, CUPS doesn't have password caching)
-      fi
     fi
   fi
   LDFLAGS="$ac_LDFLAGS_save"
@@ -93,7 +86,6 @@ fi
 if test "$ac_use_cups" = "yes"; then
   CUPSSUBDIR="cups"
   LIB_CUPS="$kde_cups_libs"
-  AC_DEFINE(HAVE_CUPS, 1, [Defines if you have CUPS (Common UNIX Printing System)])
 fi
 AM_CONDITIONAL(include_cups_SUBDIR, test -n "$CUPSSUBDIR")
 AC_SUBST(LIB_CUPS)
diff --git a/tdeprint/cups/cupsdconf2/cups-util.c b/tdeprint/cups/cupsdconf2/cups-util.c
index 907459c65..97c34715d 100644
--- a/tdeprint/cups/cupsdconf2/cups-util.c
+++ b/tdeprint/cups/cupsdconf2/cups-util.c
@@ -33,11 +33,7 @@ cupsGetConf(void)
   char		prompt[1024];		/* Prompt string */
   int		digest_tries;		/* Number of tries with Digest */
   static char	filename[HTTP_MAX_URI];	/* Local filename */
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-  const char    *fqdn = 0;
-#else
   char          fqdn[ HTTP_MAX_URI ];   /* Server name buffer */
-#endif
 
 
  /*
@@ -119,22 +115,14 @@ cupsGetConf(void)
       * See if we should retry the current digest password...
       */
 
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-      www_authenticate = cups_server->fields[HTTP_FIELD_WWW_AUTHENTICATE];
-#else
       www_authenticate = httpGetField( cups_server, HTTP_FIELD_WWW_AUTHENTICATE );
-#endif
       if (strncmp(www_authenticate, "Basic", 5) == 0 ||
           digest_tries > 1 || !pwdstring[0])
       {
        /*
 	* Nope - get a password from the user...
 	*/
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-        fqdn = cups_server->hostname;
-#else
         httpGetHostname( cups_server, fqdn, sizeof( fqdn ) );
-#endif
 
 	snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(), fqdn );
 
@@ -155,11 +143,7 @@ cupsGetConf(void)
       * Got a password; encode it for the server...
       */
 
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-      www_authenticate = cups_server->fields[HTTP_FIELD_WWW_AUTHENTICATE];
-#else
       www_authenticate = httpGetField( cups_server, HTTP_FIELD_WWW_AUTHENTICATE );
-#endif
       if (strncmp(www_authenticate, "Basic", 5) == 0)
       {
        /*
@@ -167,11 +151,7 @@ cupsGetConf(void)
 	*/
 
 	snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), pwdstring);
-#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
        httpEncode64_2(encode, sizeof(encode), plain, sizeof(plain));
-#else
-       httpEncode64(encode, plain);
-#endif
 	snprintf(authstring, sizeof(authstring), "Basic %s", encode);
       }
       else
@@ -235,13 +215,7 @@ cupsGetConf(void)
   * OK, we need to copy the file...
   */
 
-  while ((bytes =
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-          httpRead(cups_server, buffer, sizeof(buffer))
-#else
-          httpRead2(cups_server, buffer, sizeof(buffer))
-#endif
-		) > 0)
+  while ((bytes = httpRead2(cups_server, buffer, sizeof(buffer))) > 0)
   {
     write(fd, buffer, bytes);
   }
@@ -266,11 +240,7 @@ cupsPutConf(const char *name)		/* I - Name of the config file to send */
   http_status_t	status;			/* HTTP status from server */
   char		prompt[1024];		/* Prompt string */
   int		digest_tries;		/* Number of tries with Digest */
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-  const char    *fqdn = 0;
-#else
   char          fqdn[ HTTP_MAX_URI ];   /* Server name buffer */
-#endif
 
   if (name == NULL)
     return 0;
@@ -342,20 +312,12 @@ cupsPutConf(const char *name)		/* I - Name of the config file to send */
 	}
 	else
 	{
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-          httpWrite(cups_server, buffer, bytes);
-#else
           httpWrite2(cups_server, buffer, bytes);
-#endif
 	}
 
     if (status == HTTP_CONTINUE)
     {
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-        httpWrite(cups_server, buffer, 0);
-#else
         httpWrite2(cups_server, buffer, 0);
-#endif
 
 	while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
     }
@@ -382,11 +344,7 @@ cupsPutConf(const char *name)		/* I - Name of the config file to send */
       * See if we should retry the current digest password...
       */
 
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-      www_authenticate = cups_server->fields[HTTP_FIELD_WWW_AUTHENTICATE];
-#else
       www_authenticate = httpGetField( cups_server, HTTP_FIELD_WWW_AUTHENTICATE );
-#endif
       if (strncmp(www_authenticate, "Basic", 5) == 0 ||
           digest_tries > 1 || !pwdstring[0])
       {
@@ -395,11 +353,7 @@ cupsPutConf(const char *name)		/* I - Name of the config file to send */
 	*/
 
 
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-        fqdn = cups_server->hostname;
-#else
         httpGetHostname( cups_server, fqdn, sizeof( fqdn ) );
-#endif
 	snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(), fqdn );
 
         if ((password = cupsGetPassword(prompt)) == NULL)
@@ -419,11 +373,7 @@ cupsPutConf(const char *name)		/* I - Name of the config file to send */
       * Got a password; encode it for the server...
       */
 
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-      www_authenticate = cups_server->fields[HTTP_FIELD_WWW_AUTHENTICATE];
-#else
       www_authenticate = httpGetField( cups_server, HTTP_FIELD_WWW_AUTHENTICATE );
-#endif
       if (strncmp(www_authenticate, "Basic", 5) == 0)
       {
        /*
@@ -431,11 +381,7 @@ cupsPutConf(const char *name)		/* I - Name of the config file to send */
 	*/
 
 	snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), pwdstring);
-#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
        httpEncode64_2(encode, sizeof(encode), plain, sizeof(plain));
-#else
-       httpEncode64(encode, plain);
-#endif
 	snprintf(authstring, sizeof(authstring), "Basic %s", encode);
       }
       else
@@ -513,23 +459,10 @@ cups_local_auth(http_t *http)	/* I - Connection */
   * See if we are accessing localhost...
 	the struct has changed in newer versions - PiggZ (adam@piggz.co.uk)
   */
-#if (CUPS_VERSION_MAJOR >= 2)
 	if (!httpAddrLocalhost(httpGetAddress(http)))
 	{
 		return (0);
 	}
-#elif CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
-	if (!httpAddrLocalhost(http))
-	{
-		return (0);
-	}
-#else
-	if (ntohl(*(int*)&http->hostaddr.sin_addr) != 0x7f000001 &&
-	    strcasecmp(http->hostname, "localhost") != 0)
-	{
-		return (0);
-	}
-#endif
 
  /*
   * Try opening a certificate file for this PID.  If that fails,
diff --git a/tdeprint/cups/cupsdconf2/cupsdconf.cpp b/tdeprint/cups/cupsdconf2/cupsdconf.cpp
index 5cfab057d..8eda4477d 100644
--- a/tdeprint/cups/cupsdconf2/cupsdconf.cpp
+++ b/tdeprint/cups/cupsdconf2/cupsdconf.cpp
@@ -616,7 +616,9 @@ bool CupsdConf::loadAvailableResources()
 	conf.setGroup("CUPS");
 	TQString	host = conf.readEntry("Host",cupsServer());
 	int 	port = conf.readNumEntry("Port",ippPort());
-	http_t	*http_ = httpConnect(host.local8Bit(),port);
+	http_t *http_ = httpConnect2(
+		host.local8Bit(), port, NULL, AF_UNSPEC,
+		HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
 
 	resources_.clear();
 	// standard resources
@@ -634,44 +636,26 @@ bool CupsdConf::loadAvailableResources()
 	cups_lang_t*	lang = cupsLangDefault();
 	ippAddString(request_, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(lang));
 	ippAddString(request_, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, lang->language);
-#ifdef HAVE_CUPS_1_6
 	ippSetOperation(request_, CUPS_GET_PRINTERS);
-#else // HAVE_CUPS_1_6
-	request_->request.op.operation_id = CUPS_GET_PRINTERS;
-#endif // HAVE_CUPS_1_6
 	request_ = cupsDoRequest(http_, request_, "/printers/");
 	if (request_)
 	{
 		TQString	name;
 		int	type(0);
-#ifdef HAVE_CUPS_1_6
 		ipp_attribute_t	*attr = ippFirstAttribute(request_);
-#else // HAVE_CUPS_1_6
-		ipp_attribute_t	*attr = request_->attrs;
-#endif // HAVE_CUPS_1_6
 		while (attr)
 		{
 			// check new printer (keep only local non-implicit printers)
-#ifdef HAVE_CUPS_1_6
 			if (!ippGetName(attr))
-#else // HAVE_CUPS_1_6
-			if (!attr->name)
-#endif // HAVE_CUPS_1_6
 			{
 				if (!(type & CUPS_PRINTER_REMOTE) && !(type & CUPS_PRINTER_IMPLICIT) && !name.isEmpty())
 					resources_.append(new CupsResource("/printers/"+name));
 				name = "";
 				type = 0;
 			}
-#ifdef HAVE_CUPS_1_6
 			else if (strcmp(ippGetName(attr), "printer-name") == 0) name = ippGetString(attr, 0, NULL);
 			else if (strcmp(ippGetName(attr), "printer-type") == 0) type = ippGetInteger(attr, 0);
 			attr = ippNextAttribute(request_);
-#else // HAVE_CUPS_1_6
-			else if (strcmp(attr->name, "printer-name") == 0) name = attr->values[0].string.text;
-			else if (strcmp(attr->name, "printer-type") == 0) type = attr->values[0].integer;
-			attr = attr->next;
-#endif // HAVE_CUPS_1_6
 		}
 		if (!(type & CUPS_PRINTER_REMOTE) && !(type & CUPS_PRINTER_IMPLICIT) && !name.isEmpty())
 			resources_.append(new CupsResource("/printers/"+name));
@@ -681,44 +665,26 @@ bool CupsdConf::loadAvailableResources()
 	request_ = ippNew();
 	ippAddString(request_, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(lang));
 	ippAddString(request_, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, lang->language);
-#ifdef HAVE_CUPS_1_6
 	ippSetOperation(request_, CUPS_GET_CLASSES);
-#else // HAVE_CUPS_1_6
-	request_->request.op.operation_id = CUPS_GET_CLASSES;
-#endif // HAVE_CUPS_1_6
 	request_ = cupsDoRequest(http_, request_, "/classes/");
 	if (request_)
 	{
 		TQString	name;
 		int	type(0);
-#ifdef HAVE_CUPS_1_6
 		ipp_attribute_t	*attr = ippFirstAttribute(request_);
-#else // HAVE_CUPS_1_6
-		ipp_attribute_t	*attr = request_->attrs;
-#endif // HAVE_CUPS_1_6
 		while (attr)
 		{
 			// check new class (keep only local classes)
-#ifdef HAVE_CUPS_1_6
 			if (!ippGetName(attr))
-#else // HAVE_CUPS_1_6
-			if (!attr->name)
-#endif // HAVE_CUPS_1_6
 			{
 				if (!(type & CUPS_PRINTER_REMOTE) && !name.isEmpty())
 					resources_.append(new CupsResource("/classes/"+name));
 				name = "";
 				type = 0;
 			}
-#ifdef HAVE_CUPS_1_6
 			else if (strcmp(ippGetName(attr), "printer-name") == 0) name = ippGetString(attr, 0, NULL);
 			else if (strcmp(ippGetName(attr), "printer-type") == 0) type = ippGetInteger(attr, 0);
 			attr = ippNextAttribute(request_);
-#else // HAVE_CUPS_1_6
-			else if (strcmp(attr->name, "printer-name") == 0) name = attr->values[0].string.text;
-			else if (strcmp(attr->name, "printer-type") == 0) type = attr->values[0].integer;
-			attr = attr->next;
-#endif // HAVE_CUPS_1_6
 		}
 		if (!(type & CUPS_PRINTER_REMOTE) && !name.isEmpty())
 			resources_.append(new CupsResource("/classes/"+name));
diff --git a/tdeprint/cups/ipprequest.cpp b/tdeprint/cups/ipprequest.cpp
index 943eea82a..aa1891cdb 100644
--- a/tdeprint/cups/ipprequest.cpp
+++ b/tdeprint/cups/ipprequest.cpp
@@ -34,10 +34,8 @@
 #include <config.h>
 #endif
 
-#ifdef HAVE_CUPS_NO_PWD_CACHE
 #include <tqcstring.h>
 static TQCString cups_authstring = "";
-#endif
 
 void dumpRequest(ipp_t *req, bool answer = false, const TQString& s = TQString::null)
 {
@@ -52,7 +50,6 @@ void dumpRequest(ipp_t *req, bool answer = false, const TQString& s = TQString::
 		kdDebug(500) << "Null request" << endl;
 		return;
 	}
-#ifdef HAVE_CUPS_1_6
 	kdDebug(500) << "State = 0x" << TQString::number(ippGetState(req), 16) << endl;
 	kdDebug(500) << "ID = 0x" << TQString::number(ippGetRequestId(req), 16) << endl;
 	if (answer)
@@ -103,56 +100,6 @@ void dumpRequest(ipp_t *req, bool answer = false, const TQString& s = TQString::
 		kdDebug(500) << s << endl;
 		attr = ippNextAttribute(req);
 	}
-#else
-	kdDebug(500) << "State = 0x" << TQString::number(req->state, 16) << endl;
-	kdDebug(500) << "ID = 0x" << TQString::number(req->request.status.request_id, 16) << endl;
-	if (answer)
-	{
-		kdDebug(500) << "Status = 0x" << TQString::number(req->request.status.status_code, 16) << endl;
-		kdDebug(500) << "Status message = " << ippErrorString(req->request.status.status_code) << endl;
-	}
-	else
-		kdDebug(500) << "Operation = 0x" << TQString::number(req->request.op.operation_id, 16) << endl;
-	kdDebug(500) << "Version = " << (int)(req->request.status.version[0]) << "." << (int)(req->request.status.version[1]) << endl;
-	kdDebug(500) << endl;
-
-	ipp_attribute_t *attr = req->attrs;
-	while (attr)
-	{
-		TQString s = TQString::fromLatin1("%1 (0x%2) = ").arg(attr->name).arg(attr->value_tag, 0, 16);
-		for (int i=0;i<attr->num_values;i++)
-		{
-			switch (attr->value_tag)
-			{
-				case IPP_TAG_INTEGER:
-				case IPP_TAG_ENUM:
-					s += ("0x"+TQString::number(attr->values[i].integer, 16));
-					break;
-				case IPP_TAG_BOOLEAN:
-					s += (attr->values[i].boolean ? "true" : "false");
-					break;
-				case IPP_TAG_STRING:
-				case IPP_TAG_TEXT:
-				case IPP_TAG_NAME:
-				case IPP_TAG_KEYWORD:
-				case IPP_TAG_URI:
-				case IPP_TAG_MIMETYPE:
-				case IPP_TAG_NAMELANG:
-				case IPP_TAG_TEXTLANG:
-				case IPP_TAG_CHARSET:
-				case IPP_TAG_LANGUAGE:
-					s += attr->values[i].string.text;
-					break;
-				default:
-					break;
-			}
-			if (i != (attr->num_values-1))
-				s += ", ";
-		}
-		kdDebug(500) << s << endl;
-		attr = attr->next;
-	}
-#endif
 }
 
 TQString errorString(int status)
@@ -256,11 +203,7 @@ void IppRequest::addIntegerList_p(int group, int type, const TQString& name, con
 		ipp_attribute_t	*attr = ippAddIntegers(request_,(ipp_tag_t)group,(ipp_tag_t)type,name.latin1(),(int)(values.count()),NULL);
 		int	i(0);
 		for (TQValueList<int>::ConstIterator it=values.begin(); it != values.end(); ++it, i++)
-#ifdef HAVE_CUPS_1_6
 			ippSetInteger(request_, &attr, i, *it);
-#else
-			attr->values[i].integer = *it;
-#endif
 	}
 }
 
@@ -276,32 +219,19 @@ void IppRequest::addBoolean(int group, const TQString& name, const TQValueList<b
 		ipp_attribute_t	*attr = ippAddBooleans(request_,(ipp_tag_t)group,name.latin1(),(int)(values.count()),NULL);
 		int	i(0);
 		for (TQValueList<bool>::ConstIterator it=values.begin(); it != values.end(); ++it, i++)
-#ifdef HAVE_CUPS_1_6
 			ippSetBoolean(request_, &attr, i, (char)(*it));
-#else
-			attr->values[i].boolean = (char)(*it);
-#endif
 	}
 }
 
 void IppRequest::setOperation(int op)
 {
-#ifdef HAVE_CUPS_1_6
 	ippSetOperation(request_, (ipp_op_t)op);
 	ippSetRequestId(request_, 1);		// 0 is not RFC-compliant, should be at least 1
-#else
-	request_->request.op.operation_id = (ipp_op_t)op;
-	request_->request.op.request_id = 1;	// 0 is not RFC-compliant, should be at least 1
-#endif
 }
 
 int IppRequest::status()
 {
-#ifdef HAVE_CUPS_1_6
 	return (request_ ? ippGetStatusCode(request_) : (connect_ ? cupsLastError() : -2));
-#else
-	return (request_ ? request_->request.status.status_code : (connect_ ? cupsLastError() : -2));
-#endif
 }
 
 TQString IppRequest::statusMessage()
@@ -328,11 +258,7 @@ bool IppRequest::integerValue_p(const TQString& name, int& value, int type)
 	ipp_attribute_t	*attr = ippFindAttribute(request_, name.latin1(), (ipp_tag_t)type);
 	if (attr)
 	{
-#ifdef HAVE_CUPS_1_6
 		value = ippGetInteger(attr, 0);
-#else
-		value = attr->values[0].integer;
-#endif
 		return true;
 	}
 	else return false;
@@ -344,11 +270,7 @@ bool IppRequest::stringValue_p(const TQString& name, TQString& value, int type)
 	ipp_attribute_t	*attr = ippFindAttribute(request_, name.latin1(), (ipp_tag_t)type);
 	if (attr)
 	{
-#ifdef HAVE_CUPS_1_6
 		value = TQString::fromLocal8Bit(ippGetString(attr, 0, NULL));
-#else
-		value = TQString::fromLocal8Bit(attr->values[0].string.text);
-#endif
 		return true;
 	}
 	else return false;
@@ -361,13 +283,8 @@ bool IppRequest::stringListValue_p(const TQString& name, TQStringList& values, i
 	values.clear();
 	if (attr)
 	{
-#ifdef HAVE_CUPS_1_6
 		for (int i=0;i<ippGetCount(attr);i++)
 			values.append(TQString::fromLocal8Bit(ippGetString(attr, i, NULL)));
-#else
-		for (int i=0;i<attr->num_values;i++)
-			values.append(TQString::fromLocal8Bit(attr->values[i].string.text));
-#endif
 		return true;
 	}
 	else return false;
@@ -379,11 +296,7 @@ bool IppRequest::boolean(const TQString& name, bool& value)
 	ipp_attribute_t	*attr = ippFindAttribute(request_, name.latin1(), IPP_TAG_BOOLEAN);
 	if (attr)
 	{
-#ifdef HAVE_CUPS_1_6
 		value = (bool)ippGetBoolean(attr, 0);
-#else
-		value = (bool)attr->values[0].boolean;
-#endif
 		return true;
 	}
 	else return false;
@@ -395,7 +308,9 @@ bool IppRequest::doFileRequest(const TQString& res, const TQString& filename)
 	int 	myPort = port_;
 	if (myHost.isEmpty()) myHost = CupsInfos::self()->host();
 	if (myPort <= 0) myPort = CupsInfos::self()->port();
-	http_t	*HTTP = httpConnect(myHost.latin1(),myPort);
+	http_t *HTTP = httpConnect2(
+		myHost.latin1(), myPort, NULL, AF_UNSPEC,
+		HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
 
 	connect_ = (HTTP != NULL);
 
@@ -406,13 +321,7 @@ bool IppRequest::doFileRequest(const TQString& res, const TQString& filename)
 		return false;
 	}
 
-#ifdef HAVE_CUPS_NO_PWD_CACHE
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-   strncpy(  HTTP->authstring, cups_authstring.data(), HTTP_MAX_VALUE );
-#else
    httpSetAuthString( HTTP, NULL, cups_authstring.data() );
-#endif
-#endif
 
 	if (dump_ > 0)
 	{
@@ -420,13 +329,7 @@ bool IppRequest::doFileRequest(const TQString& res, const TQString& filename)
 	}
 
 	request_ = cupsDoFileRequest(HTTP, request_, (res.isEmpty() ? "/" : res.latin1()), (filename.isEmpty() ? NULL : filename.latin1()));
-#ifdef HAVE_CUPS_NO_PWD_CACHE
-#if CUPS_VERSION_MAJOR < 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 2)
-   cups_authstring = HTTP->authstring;
-#else
 	cups_authstring = httpGetAuthString( HTTP );
-#endif
-#endif
 	httpClose(HTTP);
 
 	if (dump_ > 1)
@@ -435,18 +338,10 @@ bool IppRequest::doFileRequest(const TQString& res, const TQString& filename)
 	}
 
 	/* No printers found */
-#ifdef HAVE_CUPS_1_6
 	if ( request_ && ippGetStatusCode(request_) == 0x406 )
-#else
-	if ( request_ && request_->request.status.status_code == 0x406 )
-#endif
 		return true;
 
-#ifdef HAVE_CUPS_1_6
 	if (!request_ || ippGetState(request_) == IPP_ERROR || (ippGetStatusCode(request_) & 0x0F00))
-#else
-	if (!request_ || request_->state == IPP_ERROR || (request_->request.status.status_code & 0x0F00))
-#endif
 		return false;
 
 
@@ -461,21 +356,14 @@ bool IppRequest::htmlReport(int group, TQTextStream& output)
 	output << "<tr><th bgcolor=\"dark blue\"><font color=\"white\">" << i18n("Attribute") << "</font></th>" << endl;
 	output << "<th bgcolor=\"dark blue\"><font color=\"white\">" << i18n("Values") << "</font></th></tr>" << endl;
 	// go to the first attribute of the specified group
-#ifdef HAVE_CUPS_1_6
 	ipp_attribute_t	*attr = ippFirstAttribute(request_);
 	while (attr && ippGetGroupTag(attr) != group)
 		attr = ippNextAttribute(request_);
-#else
-	ipp_attribute_t	*attr = request_->attrs;
-	while (attr && attr->group_tag != group)
-		attr = attr->next;
-#endif
 	// print each attribute
 	const ipp_uchar_t	*d;
 	TQCString		dateStr;
 	TQDateTime		dt;
 	bool			bg(false);
-#ifdef HAVE_CUPS_1_6
 	while (attr && ippGetGroupTag(attr) == group)
 	{
 		output << "  <tr bgcolor=\"" << (bg ? "#ffffd9" : "#ffffff") << "\">\n    <td><b>" << ippGetName(attr) << "</b></td>\n    <td>" << endl;
@@ -542,67 +430,6 @@ bool IppRequest::htmlReport(int group, TQTextStream& output)
 		}
 		output << "</td>\n  </tr>" << endl;
 		attr = ippNextAttribute(request_);
-#else
-	while (attr && attr->group_tag == group)
-	{
-		output << "  <tr bgcolor=\"" << (bg ? "#ffffd9" : "#ffffff") << "\">\n    <td><b>" << attr->name << "</b></td>\n    <td>" << endl;
-		bg = !bg;
-		for (int i=0; i<attr->num_values; i++)
-		{
-			switch (attr->value_tag)
-			{
-				case IPP_TAG_INTEGER:
-					if (attr->name && strstr(attr->name, "time"))
-					{
-						dt.setTime_t((unsigned int)(attr->values[i].integer));
-						output << dt.toString();
-					}
-					else
-						output << attr->values[i].integer;
-					break;
-				case IPP_TAG_ENUM:
-					output << "0x" << hex << attr->values[i].integer << dec;
-					break;
-				case IPP_TAG_BOOLEAN:
-					output << (attr->values[i].boolean ? i18n("True") : i18n("False"));
-					break;
-				case IPP_TAG_STRING:
-				case IPP_TAG_TEXTLANG:
-				case IPP_TAG_NAMELANG:
-				case IPP_TAG_TEXT:
-				case IPP_TAG_NAME:
-				case IPP_TAG_KEYWORD:
-				case IPP_TAG_URI:
-				case IPP_TAG_CHARSET:
-				case IPP_TAG_LANGUAGE:
-				case IPP_TAG_MIMETYPE:
-					output << attr->values[i].string.text;
-					break;
-				case IPP_TAG_RESOLUTION:
-					output << "( " << attr->values[i].resolution.xres
-					       << ", " << attr->values[i].resolution.yres << " )";
-					break;
-				case IPP_TAG_RANGE:
-					output << "[ " << (attr->values[i].range.lower > 0 ? attr->values[i].range.lower : 1)
-					       << ", " << (attr->values[i].range.upper > 0 ? attr->values[i].range.upper : 65535) << " ]";
-					break;
-				case IPP_TAG_DATE:
-					d = attr->values[i].date;
-					dateStr.sprintf("%.4d-%.2d-%.2d, %.2d:%.2d:%.2d %c%.2d%.2d",
-							d[0]*256+d[1], d[2], d[3],
-							d[4], d[5], d[6],
-							d[8], d[9], d[10]);
-					output << dateStr;
-					break;
-				default:
-					continue;
-			}
-			if (i < attr->num_values-1)
-				output << "<br>";
-		}
-		output << "</td>\n  </tr>" << endl;
-		attr = attr->next;
-#endif
 	}
 	// end table
 	output << "</table>" << endl;
@@ -618,7 +445,6 @@ TQMap<TQString,TQString> IppRequest::toMap(int group)
 		ipp_attribute_t	*attr = first();
 		while (attr)
 		{
-#ifdef HAVE_CUPS_1_6
 			if (group != -1 && ippGetGroupTag(attr) != group)
 			{
 				attr = ippNextAttribute(request_);
@@ -670,56 +496,6 @@ TQMap<TQString,TQString> IppRequest::toMap(int group)
 				value.truncate(value.length()-1);
 			opts[TQString::fromLocal8Bit(ippGetName(attr))] = value;
 			attr = ippNextAttribute(request_);
-#else
-			if (group != -1 && attr->group_tag != group)
-			{
-				attr = attr->next;
-				continue;
-			}
-			TQString	value;
-			for (int i=0; i<attr->num_values; i++)
-			{
-				switch (attr->value_tag)
-				{
-					case IPP_TAG_INTEGER:
-					case IPP_TAG_ENUM:
-						value.append(TQString::number(attr->values[i].integer)).append(",");
-						break;
-					case IPP_TAG_BOOLEAN:
-						value.append((attr->values[i].boolean ? "true" : "false")).append(",");
-						break;
-					case IPP_TAG_RANGE:
-						if (attr->values[i].range.lower > 0)
-							value.append(TQString::number(attr->values[i].range.lower));
-						if (attr->values[i].range.lower != attr->values[i].range.upper)
-						{
-							value.append("-");
-							if (attr->values[i].range.upper > 0)
-								value.append(TQString::number(attr->values[i].range.upper));
-						}
-						value.append(",");
-						break;
-					case IPP_TAG_STRING:
-					case IPP_TAG_TEXT:
-					case IPP_TAG_NAME:
-					case IPP_TAG_KEYWORD:
-					case IPP_TAG_URI:
-					case IPP_TAG_MIMETYPE:
-					case IPP_TAG_NAMELANG:
-					case IPP_TAG_TEXTLANG:
-					case IPP_TAG_CHARSET:
-					case IPP_TAG_LANGUAGE:
-						value.append(TQString::fromLocal8Bit(attr->values[i].string.text)).append(",");
-						break;
-					default:
-						break;
-				}
-			}
-			if (!value.isEmpty())
-				value.truncate(value.length()-1);
-			opts[TQString::fromLocal8Bit(attr->name)] = value;
-			attr = attr->next;
-#endif
 		}
 	}
 	return opts;
@@ -757,30 +533,9 @@ void IppRequest::setMap(const TQMap<TQString,TQString>& opts)
 	cupsFreeOptions(n, options);
 
 	// find an remove that annoying "document-format" attribute
-#if CUPS_VERSION_MAJOR > 1 || (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2)
     ipp_attribute_t *attr = ippFindAttribute(request_, "document-format", IPP_TAG_NAME);
     ippDeleteAttribute(request_, attr);
-#else
-	// (can't use IppDeleteAttribute as older cups doesn't have that)
-	ipp_attribute_t	*attr = request_->attrs;
-	while (attr)
-	{
-		if (attr->next && strcmp(attr->next->name, "document-format") == 0)
-		{
-			ipp_attribute_t	*attr2 = attr->next;
-			attr->next = attr2->next;
-			_ipp_free_attr(attr2);
-			break;
-		}
-		attr = attr->next;
-	}
-#endif
 }
 
-#ifdef HAVE_CUPS_1_6
 ipp_attribute_t* IppRequest::first()
 { return (request_ ? ippFirstAttribute(request_) : NULL); }
-#else
-ipp_attribute_t* IppRequest::first()
-{ return (request_ ? request_->attrs : NULL); }
-#endif
diff --git a/tdeprint/cups/ipprequest.h b/tdeprint/cups/ipprequest.h
index 8577c9b93..4c32a1477 100644
--- a/tdeprint/cups/ipprequest.h
+++ b/tdeprint/cups/ipprequest.h
@@ -74,9 +74,6 @@ public:
 	bool keyword(const TQString& name, TQStringList& value);
 	bool mime(const TQString& name, TQString& value);
 	ipp_attribute_t* first();
-#ifndef HAVE_CUPS_1_6
-	ipp_attribute_t* last();
-#endif // HAVE_CUPS_1_6
 	ipp_t* request();
 	TQMap<TQString,TQString> toMap(int group = -1);
 	void setMap(const TQMap<TQString,TQString>& opts);
@@ -183,10 +180,6 @@ inline bool IppRequest::mime(const TQString& name, TQString& value)
 inline bool IppRequest::doRequest(const TQString& res)
 { return doFileRequest(res); }
 
-#ifndef HAVE_CUPS_1_6
-inline ipp_attribute_t* IppRequest::last()
-{ return (request_ ? request_->last : NULL); }
-#endif // HAVE_CUPS_1_6
 
 inline void IppRequest::setHost(const TQString& host)
 { host_ = host; }
diff --git a/tdeprint/cups/kmcupsjobmanager.cpp b/tdeprint/cups/kmcupsjobmanager.cpp
index e2c8b02c4..3a007800d 100644
--- a/tdeprint/cups/kmcupsjobmanager.cpp
+++ b/tdeprint/cups/kmcupsjobmanager.cpp
@@ -173,7 +173,6 @@ void KMCupsJobManager::parseListAnswer(IppRequest& req, KMPrinter *pr)
 	TQString		uri;
 	while (attr)
 	{
-#ifdef HAVE_CUPS_1_6
 		TQString	name(ippGetName(attr));
 		if (name == "job-id") job->setId(ippGetInteger(attr, 0));
 		else if (name == "job-uri") job->setUri(TQString::fromLocal8Bit(ippGetString(attr, 0, NULL)));
@@ -240,74 +239,6 @@ void KMCupsJobManager::parseListAnswer(IppRequest& req, KMPrinter *pr)
 			job = new KMJob();
 		}
 		attr = nextAttr;
-#else // HAVE_CUPS_1_6
-		TQString	name(attr->name);
-		if (name == "job-id") job->setId(attr->values[0].integer);
-		else if (name == "job-uri") job->setUri(TQString::fromLocal8Bit(attr->values[0].string.text));
-		else if (name == "job-name") job->setName(TQString::fromLocal8Bit(attr->values[0].string.text));
-		else if (name == "job-state")
-		{
-			switch (attr->values[0].integer)
-			{
-				case IPP_JOB_PENDING:
-					job->setState(KMJob::Queued);
-					break;
-				case IPP_JOB_HELD:
-					job->setState(KMJob::Held);
-					break;
-				case IPP_JOB_PROCESSING:
-					job->setState(KMJob::Printing);
-					break;
-				case IPP_JOB_STOPPED:
-					job->setState(KMJob::Error);
-					break;
-				case IPP_JOB_CANCELLED:
-					job->setState(KMJob::Cancelled);
-					break;
-				case IPP_JOB_ABORTED:
-					job->setState(KMJob::Aborted);
-					break;
-				case IPP_JOB_COMPLETED:
-					job->setState(KMJob::Completed);
-					break;
-				default:
-					job->setState(KMJob::Unknown);
-					break;
-			}
-		}
-		else if (name == "job-k-octets") job->setSize(attr->values[0].integer);
-		else if (name == "job-originating-user-name") job->setOwner(TQString::fromLocal8Bit(attr->values[0].string.text));
-		else if (name == "job-k-octets-completed") job->setProcessedSize(attr->values[0].integer);
-		else if (name == "job-media-sheets") job->setPages(attr->values[0].integer);
-		else if (name == "job-media-sheets-completed") job->setProcessedPages(attr->values[0].integer);
-		else if (name == "job-printer-uri" && !pr->isRemote())
-		{
-			TQString	str(attr->values[0].string.text);
-			int	p = str.findRev('/');
-			if (p != -1)
-				job->setPrinter(str.mid(p+1));
-		}
-		else if (name == "job-priority")
-		{
-			job->setAttribute(0, TQString::fromLatin1("%1").arg(attr->values[0].integer, 3));
-		}
-		else if (name == "job-billing")
-		{
-			job->setAttributeCount(2);
-			job->setAttribute(1, TQString::fromLocal8Bit(attr->values[0].string.text));
-		}
-
-		if (name.isEmpty() || attr == req.last())
-		{
-			if (job->printer().isEmpty())
-				job->setPrinter(pr->printerName());
-			job->setRemote(pr->isRemote());
-			addJob(job);	// don't use job after this call !!!
-			job = new KMJob();
-		}
-
-		attr = attr->next;
-#endif // HAVE_CUPS_1_6
 	}
 	delete job;
 }
diff --git a/tdeprint/cups/kmcupsmanager.cpp b/tdeprint/cups/kmcupsmanager.cpp
index 8dffc7125..cf9eb35e8 100644
--- a/tdeprint/cups/kmcupsmanager.cpp
+++ b/tdeprint/cups/kmcupsmanager.cpp
@@ -491,7 +491,6 @@ void KMCupsManager::processRequest(IppRequest* req)
 	KMPrinter	*printer = new KMPrinter();
 	while (attr)
 	{
-#ifdef HAVE_CUPS_1_6
 		TQString	attrname(ippGetName(attr));
 		if (attrname == "printer-name")
 		{
@@ -539,53 +538,6 @@ void KMCupsManager::processRequest(IppRequest* req)
 			printer = new KMPrinter();
 		}
 		attr = nextAttr;
-#else // HAVE_CUPS_1_6
-		TQString	attrname(attr->name);
-		if (attrname == "printer-name")
-		{
-			TQString	value = TQString::fromLocal8Bit(attr->values[0].string.text);
-			printer->setName(value);
-			printer->setPrinterName(value);
-		}
-		else if (attrname == "printer-type")
-		{
-			int	value = attr->values[0].integer;
-			printer->setType(0);
-			printer->addType(((value & CUPS_PRINTER_CLASS) || (value & CUPS_PRINTER_IMPLICIT) ? KMPrinter::Class : KMPrinter::Printer));
-			if ((value & CUPS_PRINTER_REMOTE)) printer->addType(KMPrinter::Remote);
-			if ((value & CUPS_PRINTER_IMPLICIT)) printer->addType(KMPrinter::Implicit);
-
-			// convert printer-type attribute
-			printer->setPrinterCap( ( value & CUPS_PRINTER_OPTIONS ) >> 2 );
-		}
-		else if (attrname == "printer-state")
-		{
-			switch (attr->values[0].integer)
-			{
-				case IPP_PRINTER_IDLE: printer->setState(KMPrinter::Idle); break;
-				case IPP_PRINTER_PROCESSING: printer->setState(KMPrinter::Processing); break;
-				case IPP_PRINTER_STOPPED: printer->setState(KMPrinter::Stopped); break;
-			}
-		}
-		else if (attrname == "printer-uri-supported")
-		{
-			printer->setUri(KURL(attr->values[0].string.text));
-		}
-		else if (attrname == "printer-location")
-		{
-			printer->setLocation(TQString::fromLocal8Bit(attr->values[0].string.text));
-		}
-		else if (attrname == "printer-is-accepting-jobs")
-		{
-			printer->setAcceptJobs(attr->values[0].boolean);
-		}
-		if (attrname.isEmpty() || attr == req->last())
-		{
-			addPrinter(printer);
-			printer = new KMPrinter();
-		}
-		attr = attr->next;
-#endif // HAVE_CUPS_1_6
 	}
 	delete printer;
 }
@@ -897,7 +849,6 @@ TQStringList KMCupsManager::detectLocalPrinters()
 		ipp_attribute_t	*attr = req.first();
 		while (attr)
 		{
-#ifdef HAVE_CUPS_1_6
 			TQString	attrname(ippGetName(attr));
 			if (attrname == "device-info") desc = ippGetString(attr, 0, NULL);
 			else if (attrname == "device-make-and-model") printer = ippGetString(attr, 0, NULL);
@@ -914,23 +865,6 @@ TQStringList KMCupsManager::detectLocalPrinters()
 				uri = desc = printer = cl = TQString::null;
 			}
 			attr = nextAttr;
-#else // HAVE_CUPS_1_6
-			TQString	attrname(attr->name);
-			if (attrname == "device-info") desc = attr->values[0].string.text;
-			else if (attrname == "device-make-and-model") printer = attr->values[0].string.text;
-			else if (attrname == "device-uri") uri = attr->values[0].string.text;
-			else if ( attrname == "device-class" ) cl = attr->values[ 0 ].string.text;
-			if (attrname.isEmpty() || attr == req.last())
-			{
-				if (!uri.isEmpty())
-				{
-					if (printer == "Unknown") printer = TQString::null;
-					list << cl << uri << desc << printer;
-				}
-				uri = desc = printer = cl = TQString::null;
-			}
-			attr = attr->next;
-#endif // HAVE_CUPS_1_6
 		}
 	}
 	return list;
diff --git a/tdeprint/cups/kmcupsuimanager.cpp b/tdeprint/cups/kmcupsuimanager.cpp
index 8438a7c1b..0ff3e6b2b 100644
--- a/tdeprint/cups/kmcupsuimanager.cpp
+++ b/tdeprint/cups/kmcupsuimanager.cpp
@@ -145,7 +145,6 @@ 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);
@@ -162,24 +161,6 @@ void KMCupsUiManager::setupWizard(KMWizard *wizard)
 				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);
-				else if (strncmp(attr->values[0].string.text,"parallel",8) == 0) backend->enableBackend(KMWizard::Local,true);
-				else if (strncmp(attr->values[0].string.text,"serial",6) == 0) backend->enableBackend(KMWizard::Local,true);
-				else if (strncmp(attr->values[0].string.text,"smb",3) == 0) backend->enableBackend(KMWizard::SMB,true);
-				else if (strncmp(attr->values[0].string.text,"lpd",3) == 0) backend->enableBackend(KMWizard::LPD,true);
-				else if (strncmp(attr->values[0].string.text,"usb",3) == 0) backend->enableBackend(KMWizard::Local,true);
-				else if (strncmp(attr->values[0].string.text,"http",4) == 0 || strncmp(attr->values[0].string.text,"ipp",3) == 0)
-				{
-					backend->enableBackend(KMWizard::IPP,true);
-					backend->enableBackend(KMWizard::Custom+1,true);
-				}
-				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);
diff --git a/tdeprint/cups/kmwfax.cpp b/tdeprint/cups/kmwfax.cpp
index 15d4f8180..4f0b731d4 100644
--- a/tdeprint/cups/kmwfax.cpp
+++ b/tdeprint/cups/kmwfax.cpp
@@ -57,19 +57,11 @@ KMWFax::KMWFax(TQWidget *parent, const char *name)
 		ipp_attribute_t	*attr = req.first();
 		while (attr)
 		{
-#ifdef HAVE_CUPS_1_6
 			if (ippGetName(attr) && strcmp(ippGetName(attr),"device-uri") == 0 && strncmp(ippGetString(attr, 0, NULL),"fax",3) == 0)
 			{
 				m_list->insertItem(SmallIcon("blockdevice"),TQString::fromLatin1(ippGetString(attr, 0, NULL)));
 			}
 			attr = ippNextAttribute(req.request());
-#else // HAVE_CUPS_1_6
-			if (attr->name && strcmp(attr->name,"device-uri") == 0 && strncmp(attr->values[0].string.text,"fax",3) == 0)
-			{
-				m_list->insertItem(SmallIcon("blockdevice"),TQString::fromLatin1(attr->values[0].string.text));
-			}
-			attr = attr->next;
-#endif // HAVE_CUPS_1_6
 		}
 	}
 }
diff --git a/tdeprint/cups/kmwipp.cpp b/tdeprint/cups/kmwipp.cpp
index e2b4423d0..281e7ba91 100644
--- a/tdeprint/cups/kmwipp.cpp
+++ b/tdeprint/cups/kmwipp.cpp
@@ -61,7 +61,9 @@ bool KMWIpp::isValid(TQString& msg)
 	}
 
 	// check server
-	http_t	*HTTP = httpConnect(text(0).latin1(),p);
+	http_t *HTTP = httpConnect2(
+		text(0).latin1(), p, NULL, AF_UNSPEC,
+		HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
 	if (HTTP)
 	{
 		httpClose(HTTP);
diff --git a/tdeprint/cups/kmwippselect.cpp b/tdeprint/cups/kmwippselect.cpp
index 237d74fd1..568b64600 100644
--- a/tdeprint/cups/kmwippselect.cpp
+++ b/tdeprint/cups/kmwippselect.cpp
@@ -85,15 +85,9 @@ 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();
 	}
-- 
cgit v1.2.3

