[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeprint/cups
From:       Alex Kern <alex.kern () gmx ! de>
Date:       2006-04-25 13:00:06
Message-ID: 1145970006.257737.20083.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 533671 by kernalex:

beware compatibility with CUPS pre 1.2

 M  +19 -2     ipprequest.cpp  


--- trunk/KDE/kdelibs/kdeprint/cups/ipprequest.cpp #533670:533671
@@ -511,6 +511,23 @@
 	cupsFreeOptions(n, options);
 
 	// find an remove that annoying "document-format" attribute
-        ipp_attribute_t *attr = ippFindAttribute(request_, "document-format", IPP_TAG_NAME);
-        ippDeleteAttribute(request_, attr);
+	ipp_attribute_t *attr;
+#if CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR >= 2
+	attr = ippFindAttribute(request_, "document-format", IPP_TAG_NAME);
+	ippDeleteAttribute(request_, attr);
+#else
+	// (can't use IppDeleteAttribute as cups 1.0.9 doesn't have that)
+	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
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic