From 9b82262a4ecb30bf006bcf4f85d99181df8cbbb3 Mon Sep 17 00:00:00 2001 From: chenhuixing Date: Wed, 12 Apr 2023 09:38:44 +0800 Subject: [PATCH] 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: --- src/modules/launcher/launcher.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/launcher/launcher.cpp b/src/modules/launcher/launcher.cpp index 3c8a0e8..1ec168b 100644 --- a/src/modules/launcher/launcher.cpp +++ b/src/modules/launcher/launcher.cpp @@ -555,6 +555,7 @@ void Launcher::onCheckDesktopFile(const QString &filePath, int type) // remove item const Item &item = itemsMap[filePath]; removeDesktop(filePath); + emitItemChanged(&item, appStatusDeleted); } } @@ -983,6 +984,8 @@ void Launcher::doUninstall(DesktopInfo &info, const Item &item) return; } + removeDesktop(item.info.path); + Q_EMIT uninstallSuccess(item.info.path); // 浮窗通知