From 9bd2a121b0468816974f2a2042ba0843d93cc008 Mon Sep 17 00:00:00 2001 From: chenhuixing Date: Mon, 10 Apr 2023 18:18:51 +0800 Subject: [PATCH] fix: icon in launcher after uninstall linglong app AM used try to get the real path when the desktop file is a symbolic link and save the path to a map, but it use the path where symbolic link locate to check this desktop file is in that map or not. This mistake make removeDesktop() not to be executed when handling the event DFChanged. This "get realpath" behavior is useless, we have test these two cases: There is a symlink in /usr/share/applications/xxx.desktop pointer to /tmp/xxx.desktop 1. we remove the symlink; 2. we remove the real desktop file. whether we change the code or not, AM behavior in the same way: 1. it make launcher remove the item; 2. it cannot make launcher remove the item. case 2 is a bug. but we do not change that behavior in this commit. Log: --- src/modules/launcher/launcher.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/launcher/launcher.cpp b/src/modules/launcher/launcher.cpp index 4b09996..3c8a0e8 100644 --- a/src/modules/launcher/launcher.cpp +++ b/src/modules/launcher/launcher.cpp @@ -714,11 +714,7 @@ void Launcher::addItem(Item &item) itemsMap[item.info.id] = item; QFileInfo desktopInfo(item.info.path); - if (desktopInfo.isSymLink()) { - m_desktopAndItemMap[desktopInfo.symLinkTarget()] = item; - } else { - m_desktopAndItemMap[item.info.path] = item; - } + m_desktopAndItemMap[item.info.path] = item; } Categorytype Launcher::queryCategoryId(const Item *item)