GNOME Bugzilla – Bug 726414
Uninstalled favorite apps stick around in the dash
Last modified: 2014-03-17 14:43:31 UTC
See patch. A different approach I have considered is clearing the entire cache and just let it build up again. The approach in the patch should be better when adding/removing few apps as we don't have to rebuild the cache, on the other hand going over all values again and again when adding/removing many apps could be quite painful. Comments?
Created attachment 272009 [details] [review] app-system: Filter out stale apps from cache Since rebasing our AppSystem on GLib's facilities, we only ever append to the id-to-app cache. So if an application is uninstalled, shell_app_system_lookup_app() will still happily return it if it was cached previously. For instance if a favorite app is uninstalled, it keeps lurking in the dash until a restart. To fix, filter out removed apps from the cache when handling GAppInfoMonitor::installed-changed.
Review of attachment 272009 [details] [review]: ::: src/shell-app-system.c @@ +109,3 @@ + + return !g_file_test (g_desktop_app_info_get_filename(info), + G_FILE_TEST_EXISTS); Can we avoid the stat() here? In the indexed case, g_desktop_app_info_new() is going to be faster, and if that returns NULL we know we have to purge.
Created attachment 272014 [details] [review] app-system: Filter out stale apps from cache Sure ...
Review of attachment 272014 [details] [review]: Looks good to me
Attachment 272014 [details] pushed as 66b71a3 - app-system: Filter out stale apps from cache
*** Bug 726550 has been marked as a duplicate of this bug. ***