gdesktopappinfo: Rank Keywords matches higher than GenericName
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 7 Nov 2013 22:41:21 +0000 (23:41 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 13 Nov 2013 15:54:02 +0000 (16:54 +0100)
It makes sense to match on GenericName in case an application does
not provide any keywords, but the Keywords field has been added
to explicitly support the search case, while GenericName was used
to be displayed in menus, so it makes more sense to consider
Keywords more (or equally) relevant for search.

https://bugzilla.gnome.org/show_bug.cgi?id=711640

gio/gdesktopappinfo.c

index bf8ce89..0184c97 100644 (file)
@@ -264,8 +264,8 @@ const gchar desktop_key_match_category[N_DESKTOP_KEYS] = {
    * use the same number for the two different keys.
    */
   [DESKTOP_KEY_Name]             = 1,
-  [DESKTOP_KEY_GenericName]      = 2,
-  [DESKTOP_KEY_Keywords]         = 3,
+  [DESKTOP_KEY_Keywords]         = 2,
+  [DESKTOP_KEY_GenericName]      = 3,
   [DESKTOP_KEY_X_GNOME_FullName] = 4,
   [DESKTOP_KEY_Comment]          = 5
 };
@@ -3506,6 +3506,8 @@ g_app_info_get_default_for_uri_scheme (const char *uri_scheme)
  * applications that matched @search_string with an equal score.  The
  * outer list is sorted by score so that the first strv contains the
  * best-matching applications, and so on.
+ * The algorithm for determining matches is undefined and may change at
+ * any time.
  *
  * Returns: (array zero-terminated=1) (element-type GStrv) (transfer full): a
  *   list of strvs.  Free each item with g_strfreev() and free the outer