After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726414 - Uninstalled favorite apps stick around in the dash
Uninstalled favorite apps stick around in the dash
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 726550 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-15 14:35 UTC by Florian Müllner
Modified: 2014-03-17 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
app-system: Filter out stale apps from cache (1.88 KB, patch)
2014-03-15 14:35 UTC, Florian Müllner
reviewed Details | Review
app-system: Filter out stale apps from cache (1.89 KB, patch)
2014-03-15 14:50 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-03-15 14:35:10 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?
Comment 1 Florian Müllner 2014-03-15 14:35:13 UTC
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.
Comment 2 Giovanni Campagna 2014-03-15 14:37:45 UTC
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.
Comment 3 Florian Müllner 2014-03-15 14:50:10 UTC
Created attachment 272014 [details] [review]
app-system: Filter out stale apps from cache

Sure ...
Comment 4 Giovanni Campagna 2014-03-15 14:54:40 UTC
Review of attachment 272014 [details] [review]:

Looks good to me
Comment 5 Florian Müllner 2014-03-15 14:57:21 UTC
Attachment 272014 [details] pushed as 66b71a3 - app-system: Filter out stale apps from cache
Comment 6 Jasper St. Pierre (not reading bugmail) 2014-03-17 14:43:31 UTC
*** Bug 726550 has been marked as a duplicate of this bug. ***