GNOME Bugzilla – Bug 609702
should be able to search apps by keywords
Last modified: 2012-01-25 19:33:04 UTC
I'm using a fresh jhbuild from today. when i type 'chat' in the search box in the activities overview, only xchat is returned. empathy doesn't appear.
.desktop file contents are currently only optimized for being browsed, not for being searched. If we want people to be able to search for generic words and find the corresponding app, we will probably need to add words to lots of .desktop files (possibly as a new "Keywords" field or something?) Eg, evolution.desktop includes the words "calendar" and "schedule", but not "appointment" or "meeting".
Generally agree on the idea of keywords. There is something to be careful about, which is that keyword searching has to make sense in the UI - even currently where we don't do keyword searching but just description searching, it's pretty odd when I typing "Meeting" into the search entry and get: Applications Openoffice.org Impress Files: Meeting Notes
(updating summary since apparently "chat" does bring up empathy now)
*** Bug 646874 has been marked as a duplicate of this bug. ***
*** Bug 642633 has been marked as a duplicate of this bug. ***
As noted in duplicate bug 642633, this already exists for control center panels, via the X-GNOME-Keywords field. See http://git.gnome.org/browse/gnome-control-center/tree/panels/datetime/gnome-datetime-panel.desktop.in.in Of course, it would be good to standardize this in the .desktop file spec, but for now the Shell could start using the current X-GNOME field, and GNOME apps can add keywords if they like. This improvement would also allow to stop matching on description terms when a Keywords field is present: this way, the problem raised by Owen would go away, as only meaningful keywords would match a search.
Created attachment 199003 [details] [review] shell-app: Make use of X-GNOME-Keywords in search .desktop files have been designed for browsing, so the existing fields often produce insufficient results when used for search. gnome-control-center uses X-GNOME-Keywords for that purpose, it makes sense for us to support it in gnome-shell as well (and encourage its use outside of settings panels).
Created attachment 199040 [details] [review] shell-app: Make use of X-GNOME-Keywords in search Bug 661763 added support for X-GNOME-Keywords to GDesktopAppInfo, so we don't really need to go through gmenu for keywords.
Created attachment 199368 [details] [review] shell-app: Make use of X-GNOME-Keywords in search Bump required GIO version instead of #ifdef'ing - master already depends on unstable glib anyway.
Review of attachment 199368 [details] [review]: Looks good except for a few trivial things ::: src/shell-app.c @@ +1224,3 @@ + if (keywords) + { + int i = 0; don't like the initializer when you use i in multiple places and need a reinitialization for the second use @@ +1227,3 @@ + + while (keywords[i]) + ++i; but can use g_strv_length @@ +1314,3 @@ + if (p == app->casefolded_keywords[i]) + current_match = MATCH_PREFIX; + else if (current_match < MATCH_PREFIX) current_match is necessarily < MATCH_PREFIX
Created attachment 206126 [details] [review] shell-app: Make use of Keywords in search In reply to comment #10) > ::: src/shell-app.c > @@ +1224,3 @@ > + if (keywords) > + { > + int i = 0; > > don't like the initializer when you use i in multiple places and need a > reinitialization for the second use OK. > @@ +1227,3 @@ > + > + while (keywords[i]) > + ++i; > > but can use g_strv_length Duh. > @@ +1314,3 @@ > + if (p == app->casefolded_keywords[i]) > + current_match = MATCH_PREFIX; > + else if (current_match < MATCH_PREFIX) > > current_match is necessarily < MATCH_PREFIX Double-duh.
Review of attachment 206126 [details] [review]: Looks good
Attachment 206126 [details] pushed as 1d311e7 - shell-app: Make use of Keywords in search