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