[libdazzle] tests: add score to search results



commit f44b5b6c7b1244322a89fcb83dcc0f08f4c38ca2
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jun 3 18:18:21 2017 -0700

    tests: add score to search results

 tests/test-desktop-index.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/tests/test-desktop-index.c b/tests/test-desktop-index.c
index a6f38eb..e8d418a 100644
--- a/tests/test-desktop-index.c
+++ b/tests/test-desktop-index.c
@@ -42,6 +42,7 @@ query_cb (GObject      *object,
       const gchar *icon_name = NULL;
       g_autofree gchar *highlight = NULL;
       g_autofree gchar *escaped = NULL;
+      g_autofree gchar *subtitle = NULL;
 
       g_variant_dict_lookup (dict, "id", "&s", &id);
       g_variant_dict_lookup (dict, "title", "&s", &title);
@@ -54,11 +55,13 @@ query_cb (GObject      *object,
 
       escaped = g_markup_escape_text (title, -1);
       highlight = dzl_fuzzy_highlight (escaped, last_query, FALSE);
+      subtitle = g_strdup_printf ("%lf", dzl_fuzzy_index_match_get_score (match));
 
       suggestion = g_object_new (DZL_TYPE_SUGGESTION,
                                  "id", id,
                                  "icon-name", icon_name,
                                  "title", highlight,
+                                 "subtitle", subtitle,
                                  NULL);
 
       g_list_store_append (suggestions, suggestion);


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