mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
Only return QPixmap when it is not null
QFile::exists() returns true even for executables in $PATH, and loading those files with QPixmap() will return a null object. Change-Id: I29a954aa2d504ca051b7328978426b6b993da753
This commit is contained in:
parent
b0c14898f3
commit
90e102335b
Notes:
Deepin Code Review
2017-02-21 09:15:35 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: Hualet Wang <mr.asianwang@gmail.com> Submitted-by: Hualet Wang <mr.asianwang@gmail.com> Submitted-at: Tue, 21 Feb 2017 09:15:31 +0800 Reviewed-on: https://cr.deepin.io/20482 Project: dde/dde-dock Branch: refs/heads/master
@ -18,8 +18,11 @@ QPixmap ThemeAppIcon::getIcon(const QString iconName, const int size)
|
||||
{
|
||||
QPixmap pixmap(size, size);
|
||||
|
||||
if (QFile::exists(iconName))
|
||||
return QPixmap(iconName);
|
||||
if (QFile::exists(iconName)) {
|
||||
pixmap = QPixmap(iconName);
|
||||
if (!pixmap.isNull())
|
||||
return pixmap;
|
||||
}
|
||||
if (iconName.startsWith("data:image/"))
|
||||
{
|
||||
const QStringList strs = iconName.split("base64,");
|
||||
|
Loading…
x
Reference in New Issue
Block a user