Fix potential icon request loop
This commit is contained in:
parent
21b3819a86
commit
ba2a826b56
2 changed files with 3 additions and 1 deletions
|
@ -137,7 +137,7 @@ void IppPrinter::MaybeGetStrings()
|
||||||
|
|
||||||
void IppPrinter::MaybeGetIcon(bool retry)
|
void IppPrinter::MaybeGetIcon(bool retry)
|
||||||
{
|
{
|
||||||
if(_attrs.contains("printer-icons") && (_icon.isNull() || retry))
|
if(_attrs.contains("printer-icons") && (_icon.isNull() || retry) && !_iconRetried)
|
||||||
{
|
{
|
||||||
QUrl url;
|
QUrl url;
|
||||||
QJsonArray icons = _attrs["printer-icons"].toObject()["value"].toArray();
|
QJsonArray icons = _attrs["printer-icons"].toObject()["value"].toArray();
|
||||||
|
@ -167,6 +167,7 @@ void IppPrinter::MaybeGetIcon(bool retry)
|
||||||
emit doGetImage(url);
|
emit doGetImage(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_iconRetried = retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,7 @@ private:
|
||||||
QThread _workerThread;
|
QThread _workerThread;
|
||||||
PrinterWorker _worker;
|
PrinterWorker _worker;
|
||||||
|
|
||||||
|
bool _iconRetried = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // IPPPRINTER_H
|
#endif // IPPPRINTER_H
|
||||||
|
|
Loading…
Reference in a new issue