Invalidate printer attrs later
(either when new ones are avaialble, or the request failed)
This commit is contained in:
parent
2604c65466
commit
03653e13e6
1 changed files with 8 additions and 5 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue