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:
This commit is contained in:
parent
729d7db75f
commit
9bd2a121b0
@ -714,11 +714,7 @@ void Launcher::addItem(Item &item)
|
|||||||
itemsMap[item.info.id] = item;
|
itemsMap[item.info.id] = item;
|
||||||
|
|
||||||
QFileInfo desktopInfo(item.info.path);
|
QFileInfo desktopInfo(item.info.path);
|
||||||
if (desktopInfo.isSymLink()) {
|
m_desktopAndItemMap[item.info.path] = item;
|
||||||
m_desktopAndItemMap[desktopInfo.symLinkTarget()] = item;
|
|
||||||
} else {
|
|
||||||
m_desktopAndItemMap[item.info.path] = item;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Categorytype Launcher::queryCategoryId(const Item *item)
|
Categorytype Launcher::queryCategoryId(const Item *item)
|
||||||
|
Loading…
Reference in New Issue
Block a user