Invalidate printer attrs later

(either when new ones are avaialble, or the request failed)
This commit is contained in:
Anton Thomasson 2020-10-11 16:27:46 +02:00
parent 2604c65466
commit 03653e13e6

View file

@ -94,11 +94,11 @@ void IppPrinter::onUrlChanged()
} }
void IppPrinter::refresh() { void IppPrinter::refresh() {
_attrs = QJsonObject(); // _attrs = QJsonObject();
emit attrsChanged(); // emit attrsChanged();
_additionalDocumentFormats = QStringList(); // _additionalDocumentFormats = QStringList();
emit additionalDocumentFormatsChanged(); // emit additionalDocumentFormatsChanged();
QNetworkRequest request; QNetworkRequest request;
@ -118,6 +118,8 @@ void IppPrinter::getPrinterAttributesFinished(QNetworkReply *reply)
{ {
qDebug() << reply->error() << reply->errorString() << reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString(); qDebug() << reply->error() << reply->errorString() << reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString();
_attrs = QJsonObject(); _attrs = QJsonObject();
_additionalDocumentFormats = QStringList();
if(reply->error() == QNetworkReply::NoError) if(reply->error() == QNetworkReply::NoError)
{ {
try { try {
@ -152,10 +154,11 @@ void IppPrinter::getPrinterAttributesFinished(QNetworkReply *reply)
} }
} }
qDebug() << "additionalDocumentFormats" << _additionalDocumentFormats; qDebug() << "additionalDocumentFormats" << _additionalDocumentFormats;
emit additionalDocumentFormatsChanged();
} }
emit attrsChanged(); emit attrsChanged();
emit additionalDocumentFormatsChanged();
} }
void IppPrinter::printRequestFinished(QNetworkReply *reply) void IppPrinter::printRequestFinished(QNetworkReply *reply)