Skip to content

Commit

Permalink
kdirmodel: Return "unknown" icon when the icon is null
Browse files Browse the repository at this point in the history
The behavior is the same as that of KStandardItemListWidget in Dolphin,
so the fallback icon will show on the item if the icon is a null icon.

BUG: 447573
  • Loading branch information
easyteacher committed Dec 29, 2021
1 parent cc5efa4 commit b7e0934
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/kdirmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ QVariant KDirModel::data(const QModelIndex &index, int role) const
}
Q_ASSERT(!item.isNull());
// qDebug() << item->url() << " overlays=" << item->overlays();
return KIconUtils::addOverlays(item.iconName(), item.overlays());
return KIconUtils::addOverlays(QIcon::fromTheme(item.iconName(), QIcon::fromTheme(QStringLiteral("unknown"))), item.overlays());
}
break;
case Qt::TextAlignmentRole:
Expand Down

0 comments on commit b7e0934

Please sign in to comment.