summaryrefslogtreecommitdiffstats
path: root/tdeprint/cups/ipprequest.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-27 19:34:50 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-27 19:34:50 +0900
commit9468d05e3d2c56d4287ef464a31f21a689ad7e14 (patch)
treeadf22710dca7ba948cfbd53e82036ea854727e64 /tdeprint/cups/ipprequest.cpp
parent225e0d0b0f6d86433af9ee534e3a4d298289bc1d (diff)
downloadtdelibs-9468d05e3d2c56d4287ef464a31f21a689ad7e14.tar.gz
tdelibs-9468d05e3d2c56d4287ef464a31f21a689ad7e14.zip
Fixed second pass uncrustify's code formatting offending files.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeprint/cups/ipprequest.cpp')
-rw-r--r--tdeprint/cups/ipprequest.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/tdeprint/cups/ipprequest.cpp b/tdeprint/cups/ipprequest.cpp
index 8a363152b..943eea82a 100644
--- a/tdeprint/cups/ipprequest.cpp
+++ b/tdeprint/cups/ipprequest.cpp
@@ -103,7 +103,7 @@ void dumpRequest(ipp_t *req, bool answer = false, const TQString& s = TQString::
kdDebug(500) << s << endl;
attr = ippNextAttribute(req);
}
-#else // HAVE_CUPS_1_6
+#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)
@@ -152,7 +152,7 @@ void dumpRequest(ipp_t *req, bool answer = false, const TQString& s = TQString::
kdDebug(500) << s << endl;
attr = attr->next;
}
-#endif // HAVE_CUPS_1_6
+#endif
}
TQString errorString(int status)
@@ -258,9 +258,9 @@ void IppRequest::addIntegerList_p(int group, int type, const TQString& name, con
for (TQValueList<int>::ConstIterator it=values.begin(); it != values.end(); ++it, i++)
#ifdef HAVE_CUPS_1_6
ippSetInteger(request_, &attr, i, *it);
-#else // HAVE_CUPS_1_6
+#else
attr->values[i].integer = *it;
-#endif // HAVE_CUPS_1_6
+#endif
}
}
@@ -278,9 +278,9 @@ void IppRequest::addBoolean(int group, const TQString& name, const TQValueList<b
for (TQValueList<bool>::ConstIterator it=values.begin(); it != values.end(); ++it, i++)
#ifdef HAVE_CUPS_1_6
ippSetBoolean(request_, &attr, i, (char)(*it));
-#else // HAVE_CUPS_1_6
+#else
attr->values[i].boolean = (char)(*it);
-#endif // HAVE_CUPS_1_6
+#endif
}
}
@@ -289,19 +289,19 @@ 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 // HAVE_CUPS_1_6
+#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 // HAVE_CUPS_1_6
+#endif
}
int IppRequest::status()
{
#ifdef HAVE_CUPS_1_6
return (request_ ? ippGetStatusCode(request_) : (connect_ ? cupsLastError() : -2));
-#else // HAVE_CUPS_1_6
+#else
return (request_ ? request_->request.status.status_code : (connect_ ? cupsLastError() : -2));
-#endif // HAVE_CUPS_1_6
+#endif
}
TQString IppRequest::statusMessage()
@@ -330,9 +330,9 @@ bool IppRequest::integerValue_p(const TQString& name, int& value, int type)
{
#ifdef HAVE_CUPS_1_6
value = ippGetInteger(attr, 0);
-#else // HAVE_CUPS_1_6
+#else
value = attr->values[0].integer;
-#endif // HAVE_CUPS_1_6
+#endif
return true;
}
else return false;
@@ -346,9 +346,9 @@ bool IppRequest::stringValue_p(const TQString& name, TQString& value, int type)
{
#ifdef HAVE_CUPS_1_6
value = TQString::fromLocal8Bit(ippGetString(attr, 0, NULL));
-#else // HAVE_CUPS_1_6
+#else
value = TQString::fromLocal8Bit(attr->values[0].string.text);
-#endif // HAVE_CUPS_1_6
+#endif
return true;
}
else return false;
@@ -364,10 +364,10 @@ bool IppRequest::stringListValue_p(const TQString& name, TQStringList& values, i
#ifdef HAVE_CUPS_1_6
for (int i=0;i<ippGetCount(attr);i++)
values.append(TQString::fromLocal8Bit(ippGetString(attr, i, NULL)));
-#else // HAVE_CUPS_1_6
+#else
for (int i=0;i<attr->num_values;i++)
values.append(TQString::fromLocal8Bit(attr->values[i].string.text));
-#endif // HAVE_CUPS_1_6
+#endif
return true;
}
else return false;
@@ -381,9 +381,9 @@ bool IppRequest::boolean(const TQString& name, bool& value)
{
#ifdef HAVE_CUPS_1_6
value = (bool)ippGetBoolean(attr, 0);
-#else // HAVE_CUPS_1_6
+#else
value = (bool)attr->values[0].boolean;
-#endif // HAVE_CUPS_1_6
+#endif
return true;
}
else return false;
@@ -437,16 +437,16 @@ bool IppRequest::doFileRequest(const TQString& res, const TQString& filename)
/* No printers found */
#ifdef HAVE_CUPS_1_6
if ( request_ && ippGetStatusCode(request_) == 0x406 )
-#else // HAVE_CUPS_1_6
+#else
if ( request_ && request_->request.status.status_code == 0x406 )
-#endif // HAVE_CUPS_1_6
+#endif
return true;
#ifdef HAVE_CUPS_1_6
if (!request_ || ippGetState(request_) == IPP_ERROR || (ippGetStatusCode(request_) & 0x0F00))
-#else // HAVE_CUPS_1_6
+#else
if (!request_ || request_->state == IPP_ERROR || (request_->request.status.status_code & 0x0F00))
-#endif // HAVE_CUPS_1_6
+#endif
return false;
@@ -465,11 +465,11 @@ bool IppRequest::htmlReport(int group, TQTextStream& output)
ipp_attribute_t *attr = ippFirstAttribute(request_);
while (attr && ippGetGroupTag(attr) != group)
attr = ippNextAttribute(request_);
-#else // HAVE_CUPS_1_6
+#else
ipp_attribute_t *attr = request_->attrs;
while (attr && attr->group_tag != group)
attr = attr->next;
-#endif // HAVE_CUPS_1_6
+#endif
// print each attribute
const ipp_uchar_t *d;
TQCString dateStr;
@@ -542,7 +542,7 @@ bool IppRequest::htmlReport(int group, TQTextStream& output)
}
output << "</td>\n </tr>" << endl;
attr = ippNextAttribute(request_);
-#else // HAVE_CUPS_1_6
+#else
while (attr && attr->group_tag == group)
{
output << " <tr bgcolor=\"" << (bg ? "#ffffd9" : "#ffffff") << "\">\n <td><b>" << attr->name << "</b></td>\n <td>" << endl;
@@ -602,7 +602,7 @@ bool IppRequest::htmlReport(int group, TQTextStream& output)
}
output << "</td>\n </tr>" << endl;
attr = attr->next;
-#endif // HAVE_CUPS_1_6
+#endif
}
// end table
output << "</table>" << endl;
@@ -670,7 +670,7 @@ TQMap<TQString,TQString> IppRequest::toMap(int group)
value.truncate(value.length()-1);
opts[TQString::fromLocal8Bit(ippGetName(attr))] = value;
attr = ippNextAttribute(request_);
-#else // HAVE_CUPS_1_6
+#else
if (group != -1 && attr->group_tag != group)
{
attr = attr->next;
@@ -719,7 +719,7 @@ TQMap<TQString,TQString> IppRequest::toMap(int group)
value.truncate(value.length()-1);
opts[TQString::fromLocal8Bit(attr->name)] = value;
attr = attr->next;
-#endif // HAVE_CUPS_1_6
+#endif
}
}
return opts;
@@ -780,7 +780,7 @@ void IppRequest::setMap(const TQMap<TQString,TQString>& opts)
#ifdef HAVE_CUPS_1_6
ipp_attribute_t* IppRequest::first()
{ return (request_ ? ippFirstAttribute(request_) : NULL); }
-#else // HAVE_CUPS_1_6
+#else
ipp_attribute_t* IppRequest::first()
{ return (request_ ? request_->attrs : NULL); }
-#endif // HAVE_CUPS_1_6
+#endif