[recipes] Don't show dairy warning for vegan recipes



commit 53c528aba8c53e70343ecbae36afb36cbddcd36d
Author: Matthew Leeds <mleeds redhat com>
Date:   Sun Jan 22 14:12:59 2017 -0600

    Don't show dairy warning for vegan recipes
    
    Vegan recipes by definition can't contain dairy so we shouldn't show a
    warning for it even if the milk-free flag isn't set. Another solution
    would be to set the milk-free flag for all vegan recipes, but the code
    seems to make the assumption that each recipe has only one diet flag
    set.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777621

 src/gr-recipe.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipe.c b/src/gr-recipe.c
index 91a73fe..83f28d8 100644
--- a/src/gr-recipe.c
+++ b/src/gr-recipe.c
@@ -613,7 +613,8 @@ gr_recipe_contains_garlic (GrRecipe *recipe)
 gboolean
 gr_recipe_contains_dairy (GrRecipe *recipe)
 {
-        return (recipe->diets & GR_DIET_MILK_FREE) == 0;
+        return (recipe->diets & GR_DIET_MILK_FREE) == 0 &&
+               (recipe->diets & GR_DIET_VEGAN) == 0;
 }
 
 gboolean


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