[recipes] Try to make translated ingredients work for search



commit 2fe39e2ea1b8197a63ea201b15b4beaf93933e1b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Dec 31 16:01:05 2016 -0500

    Try to make translated ingredients work for search

 src/gr-ingredient-row.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/gr-ingredient-row.c b/src/gr-ingredient-row.c
index 439df31..8d509c7 100644
--- a/src/gr-ingredient-row.c
+++ b/src/gr-ingredient-row.c
@@ -171,10 +171,17 @@ gr_ingredient_row_set_property (GObject      *object,
         switch (prop_id)
           {
           case PROP_INGREDIENT:
-                  g_free (self->ingredient);
-                  self->ingredient = g_value_dup_string (value);
-                  g_free (self->cf_ingredient);
-                  self->cf_ingredient = g_utf8_casefold (self->ingredient, -1);
+                  {
+                        const char *term;
+
+                        g_free (self->ingredient);
+                        self->ingredient = g_value_dup_string (value);
+                        term = gr_ingredient_get_id (self->ingredient);
+                        if (!term)
+                                term = self->ingredient;
+                        g_free (self->cf_ingredient);
+                        self->cf_ingredient = g_utf8_casefold (term, -1);
+                  }
                   break;
           case PROP_INCLUDE:
                   self->include = g_value_get_boolean (value);


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