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 609702 - should be able to search apps by keywords
should be able to search apps by keywords
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 642633 646874 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-02-12 01:19 UTC by Máirín Duffy
Modified: 2012-01-25 19:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell-app: Make use of X-GNOME-Keywords in search (3.47 KB, patch)
2011-10-14 12:58 UTC, Florian Müllner
none Details | Review
shell-app: Make use of X-GNOME-Keywords in search (3.02 KB, patch)
2011-10-14 22:02 UTC, Florian Müllner
none Details | Review
shell-app: Make use of X-GNOME-Keywords in search (3.34 KB, patch)
2011-10-18 21:23 UTC, Florian Müllner
needs-work Details | Review
shell-app: Make use of Keywords in search (2.89 KB, patch)
2012-01-25 19:16 UTC, Florian Müllner
committed Details | Review

Description Máirín Duffy 2010-02-12 01:19: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.
Comment 1 Dan Winship 2010-02-15 14:59:25 UTC
.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".
Comment 2 Owen Taylor 2010-02-15 15:06:55 UTC
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
Comment 3 Dan Winship 2011-04-08 13:08:31 UTC
(updating summary since apparently "chat" does bring up empathy now)
Comment 4 Dan Winship 2011-04-08 13:08:39 UTC
*** Bug 646874 has been marked as a duplicate of this bug. ***
Comment 5 Milan Bouchet-Valat 2011-04-30 09:53:08 UTC
*** Bug 642633 has been marked as a duplicate of this bug. ***
Comment 6 Milan Bouchet-Valat 2011-04-30 09:57:31 UTC
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.
Comment 7 Florian Müllner 2011-10-14 12:58:05 UTC
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).
Comment 8 Florian Müllner 2011-10-14 22:02:47 UTC
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.
Comment 9 Florian Müllner 2011-10-18 21:23:44 UTC
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.
Comment 10 Owen Taylor 2012-01-25 18:56:41 UTC
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
Comment 11 Florian Müllner 2012-01-25 19:16:24 UTC
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.
Comment 12 Owen Taylor 2012-01-25 19:28:44 UTC
Review of attachment 206126 [details] [review]:

Looks good
Comment 13 Florian Müllner 2012-01-25 19:32:59 UTC
Attachment 206126 [details] pushed as 1d311e7 - shell-app: Make use of Keywords in search