[glib] gdesktopappinfo: Rank Keywords matches higher than GenericName



commit 2fb8901b647f94f74a79f5017793d6c6ed2af981
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Nov 7 23:41:21 2013 +0100

    gdesktopappinfo: Rank Keywords matches higher than GenericName
    
    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 |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index bf8ce89..0184c97 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]