Fix potential icon request loop

This commit is contained in:
Anton Thomasson 2022-05-19 20:49:57 +02:00
parent 21b3819a86
commit ba2a826b56
2 changed files with 3 additions and 1 deletions

View file

@ -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;
} }

View file

@ -130,6 +130,7 @@ private:
QThread _workerThread; QThread _workerThread;
PrinterWorker _worker; PrinterWorker _worker;
bool _iconRetried = false;
}; };
#endif // IPPPRINTER_H #endif // IPPPRINTER_H