mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
QzTools: Return empty url when pixmap is null in pixmapToDataUrl
This commit is contained in:
parent
18926fd85b
commit
e4abb59d3a
|
@ -77,7 +77,8 @@ QPixmap QzTools::pixmapFromByteArray(const QByteArray &data)
|
|||
|
||||
QUrl QzTools::pixmapToDataUrl(const QPixmap &pix)
|
||||
{
|
||||
return QUrl(QSL("data:image/png;base64,") + QString(pixmapToByteArray(pix)));
|
||||
const QString data(pixmapToByteArray(pix));
|
||||
return data.isEmpty() ? QUrl() : QUrl(QSL("data:image/png;base64,") + data);
|
||||
}
|
||||
|
||||
QString QzTools::readAllFileContents(const QString &filename)
|
||||
|
|
Loading…
Reference in New Issue
Block a user