Skip to content

Commit 735c434

Browse files
committed
fix: empty icon on task manager in some cases
修复部分场景下可能导致错误识别 desktopId,导致任务栏图标被隐藏. Log:
1 parent abf8a87 commit 735c434

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

panels/dock/taskmanager/taskmanager.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,17 @@ void TaskManager::handleWindowAdded(QPointer<AbstractWindow> window)
129129
}
130130

131131
QSharedPointer<DesktopfileAbstractParser> desktopfile = nullptr;
132+
QString desktopId;
132133
if (res.size() > 0) {
133-
desktopfile = DESKTOPFILEFACTORY::createById(res.first().data(m_activeAppModel->roleNames().key("desktopId")).toString(), "amAPP");
134+
desktopId = res.first().data(m_activeAppModel->roleNames().key("desktopId")).toString();
135+
}
136+
137+
if (!desktopId.isEmpty()) {
138+
desktopfile = DESKTOPFILEFACTORY::createById(desktopId, "amAPP");
134139
}
135140

136141
if (desktopfile.isNull() || !desktopfile->isValied().first) {
137-
if (res.size() > 0) {
138-
desktopfile = DESKTOPFILEFACTORY::createById(res.first().data(m_activeAppModel->roleNames().key("desktopId")).toString(), "asbtractAPP");
139-
} else {
140-
desktopfile = DESKTOPFILEFACTORY::createByWindow(window);
141-
}
142+
desktopfile = DESKTOPFILEFACTORY::createByWindow(window);
142143
}
143144

144145
auto appitem = desktopfile->getAppItem();

0 commit comments

Comments
 (0)