[recipes] Make recipe editing work again



commit 9101f46c72e0be29ad254e149617d055abd9c713
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 26 07:52:30 2017 -0400

    Make recipe editing work again
    
    We were creating a bad entry in the model that is
    used for unit completion. Fix that.

 src/gr-ingredients-viewer-row.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/gr-ingredients-viewer-row.c b/src/gr-ingredients-viewer-row.c
index 88aa436..e3add41 100644
--- a/src/gr-ingredients-viewer-row.c
+++ b/src/gr-ingredients-viewer-row.c
@@ -706,7 +706,7 @@ get_units_model (GrIngredientsViewerRow *row)
                                                    4, "",
                                                    -1);
 
-                for (i = GR_UNIT_UNKNOWN; i <= GR_LAST_UNIT; i++) {
+                for (i = GR_UNIT_UNKNOWN + 1; i <= GR_LAST_UNIT; i++) {
                         const char *abbrev;
                         const char *name;
                         const char *plural;
@@ -718,15 +718,14 @@ get_units_model (GrIngredientsViewerRow *row)
                         name = gr_unit_get_display_name (i);
                         plural = gr_unit_get_plural (i);
 
-
-                        if (strcmp (abbrev, name) == 0)
+                        if (g_strcmp0 (abbrev, name) == 0)
                                 tmp = g_strdup (name);
                         else
                                 tmp = g_strdup_printf ("%s (%s)", name, abbrev);
 
-                        if (strcmp (abbrev, plural) == 0)
+                        if (g_strcmp0 (abbrev, plural) == 0)
                                 tmp2 = g_strdup (name);
-                        else 
+                        else
                                 tmp2 = g_strdup_printf ("%s (%s)", plural, abbrev);
 
                         gtk_list_store_insert_with_values (store, NULL, -1,


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