[FIX]修复桌面文件设置多个角标后左上角不显示角标的问题[LINK]bug#132955

This commit is contained in:
Qxiangwenjie 2022-08-04 09:55:46 +08:00 committed by Yue-Lan
parent deeba79f19
commit 1ee96d4050
1 changed files with 2 additions and 1 deletions

View File

@ -227,7 +227,6 @@ void DesktopIconViewDelegate::paint(QPainter *painter, const QStyleOptionViewIte
//paint link icon and locker icon
FileInfo* file = FileInfo::fromUri(index.data(Qt::UserRole).toString()).get();
if ((index.data(Qt::UserRole).toString() != "computer:///") && (index.data(Qt::UserRole).toString() != "trash:///")) {
emblemPoses.removeOne(1);
QSize lockerIconSize = QSize(16, 16);
int offset = 8;
switch (view->zoomLevel()) {
@ -260,12 +259,14 @@ void DesktopIconViewDelegate::paint(QPainter *painter, const QStyleOptionViewIte
if (! file->canRead())
{
emblemPoses.removeOne(1);
QIcon symbolicLinkIcon = QIcon::fromTheme("emblem-unreadable");
symbolicLinkIcon.paint(painter, linkRect, Qt::AlignCenter);
}
else if(! file->canWrite()/* && ! file->canExecute()*/)
{
//只读图标对应可读不可写情况与可执行权限无关link to bug#99998
emblemPoses.removeOne(1);
QIcon symbolicLinkIcon = QIcon::fromTheme("emblem-readonly");
symbolicLinkIcon.paint(painter, linkRect, Qt::AlignCenter);
}