Improve additional format detection
This commit is contained in:
parent
35d3e44ffd
commit
a73b0b734a
1 changed files with 6 additions and 5 deletions
|
@ -135,14 +135,14 @@ void IppPrinter::getPrinterAttributesFinished(QNetworkReply *reply)
|
||||||
for (QStringList::iterator it = printerDeviceId.begin(); it != printerDeviceId.end(); it++)
|
for (QStringList::iterator it = printerDeviceId.begin(); it != printerDeviceId.end(); it++)
|
||||||
{
|
{
|
||||||
QStringList kv = it->split(":");
|
QStringList kv = it->split(":");
|
||||||
if(kv.length()==2 && kv[0]=="CMD")
|
if(kv.length()==2 && (kv[0]=="CMD" || kv[0]=="COMMAND SET"))
|
||||||
{
|
{
|
||||||
QStringList cmds = kv[1].split(",");
|
if(!supportedMimeTypes.contains("application/pdf") && kv[1].contains("PDF"))
|
||||||
if(cmds.contains("PDF") && !supportedMimeTypes.contains("application/pdf"))
|
|
||||||
{
|
{
|
||||||
_additionalDocumentFormats.append("application/pdf");
|
_additionalDocumentFormats.append("application/pdf");
|
||||||
}
|
}
|
||||||
if(cmds.contains("POSTSCRIPT") && !supportedMimeTypes.contains("application/postscript"))
|
if(!supportedMimeTypes.contains("application/postscript") &&
|
||||||
|
kv[1].contains("Postscript", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
_additionalDocumentFormats.append("application/postscript");
|
_additionalDocumentFormats.append("application/postscript");
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,8 @@ void IppPrinter::printRequestFinished(QNetworkReply *reply)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_jobAttrs.insert("job-state-message", QJsonObject {{"tag", IppMsg::TextWithoutLanguage}, {"value", "Network error"}});
|
_jobAttrs.insert("job-state-message", QJsonObject {{"tag", IppMsg::TextWithoutLanguage},
|
||||||
|
{"value", "Network error"}});
|
||||||
}
|
}
|
||||||
emit jobAttrsChanged();
|
emit jobAttrsChanged();
|
||||||
emit jobFinished(status);
|
emit jobFinished(status);
|
||||||
|
|
Loading…
Reference in a new issue