[recipes] Don't consider an empty amount as invalid



commit b6135df983c8859822a5f01dfc1e1491b59db5ad
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 27 18:57:54 2017 -0400

    Don't consider an empty amount as invalid
    
    It is sometimes desirable to just specify an ingredient
    without stating the amount, and we do have recipes in
    the dataset that make use of this.

 src/gr-ingredients-viewer-row.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-ingredients-viewer-row.c b/src/gr-ingredients-viewer-row.c
index 0b47ca6..5b9aeea 100644
--- a/src/gr-ingredients-viewer-row.c
+++ b/src/gr-ingredients-viewer-row.c
@@ -860,7 +860,7 @@ setup_editable_row (GrIngredientsViewerRow *self)
 GtkWidget *
 gr_ingredients_viewer_row_has_error (GrIngredientsViewerRow *row)
 {
-        if (row->amount == NULL || row->amount[0] == '\0')
+        if (gtk_style_context_has_class (gtk_widget_get_style_context (row->unit_label), "error"))
                 return gtk_widget_get_parent (row->unit_label);
 
         if (row->ingredient == NULL || row->ingredient[0] == '\0')


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