From 8fdf215f033f3749b8f979201b61a569b4d184f2 Mon Sep 17 00:00:00 2001 From: Gong Heng Date: Sat, 30 Nov 2024 18:05:27 +0800 Subject: [PATCH] fix: [emblem] gio emblem show error Logic error,the gio emblem not show the right pos. Log: fix issue Bug: https://pms.uniontech.com/bug-view-278805.html --- .../common/dfmplugin-emblem/utils/emblemmanager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/common/dfmplugin-emblem/utils/emblemmanager.cpp b/src/plugins/common/dfmplugin-emblem/utils/emblemmanager.cpp index 2daf1d8253..4ef48655e3 100644 --- a/src/plugins/common/dfmplugin-emblem/utils/emblemmanager.cpp +++ b/src/plugins/common/dfmplugin-emblem/utils/emblemmanager.cpp @@ -46,7 +46,18 @@ bool EmblemManager::paintEmblems(int role, const FileInfoPointer &info, QPainter if (!helper->isExtEmblemProhibited(info, url)) { // add gio embelm icons helper->pending(info); - emblems.append(helper->gioEmblemIcons(url)); + int systemEmblemsSize = emblems.size(); + if (systemEmblemsSize == 0) { + emblems.append(helper->gioEmblemIcons(url)); + } else if (systemEmblemsSize > 0 && systemEmblemsSize < 4) { + const QList &gioIcons { helper->gioEmblemIcons(url) }; + int gioIconsSize { gioIcons.size() }; + if (gioIconsSize > systemEmblemsSize) { + for (int i = systemEmblemsSize; i < gioIconsSize; ++i) { + emblems.append(gioIcons[i]); + } + } + } // add custom emblem icons EmblemEventSequence::instance()->doFetchCustomEmblems(url, &emblems);