fix: desktop file still in Desktop after uninstall

AM will emit a signal which named UninstallSuccess when we
click launcher to uninstall the app of linglong. Then launcher
request item data after listen this signal and it will call AM
to refresh the data map. This make AM think the desktop item has
been removed when the fs notify event arrive, which cause AM
won't remove the desktop file.
So we just do removeDesktop() before emit the signal.

Log:
This commit is contained in:
chenhuixing 2023-04-12 09:38:44 +08:00 committed by zsien
parent 9bd2a121b0
commit 9b82262a4e

View File

@ -555,6 +555,7 @@ void Launcher::onCheckDesktopFile(const QString &filePath, int type)
// remove item // remove item
const Item &item = itemsMap[filePath]; const Item &item = itemsMap[filePath];
removeDesktop(filePath); removeDesktop(filePath);
emitItemChanged(&item, appStatusDeleted); emitItemChanged(&item, appStatusDeleted);
} }
} }
@ -983,6 +984,8 @@ void Launcher::doUninstall(DesktopInfo &info, const Item &item)
return; return;
} }
removeDesktop(item.info.path);
Q_EMIT uninstallSuccess(item.info.path); Q_EMIT uninstallSuccess(item.info.path);
// 浮窗通知 // 浮窗通知