[recipes] cooking: Always recreate steps



commit 65136a5caca2c19247bdddf12a360b1989754379
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 13 07:44:10 2017 -0500

    cooking: Always recreate steps
    
    Otherwise, stopping cooking mode and restarting it with the same
    recipe will not reset running timers.

 src/gr-cooking-page.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/gr-cooking-page.c b/src/gr-cooking-page.c
index 9cb9b9f..a630be1 100644
--- a/src/gr-cooking-page.c
+++ b/src/gr-cooking-page.c
@@ -403,15 +403,15 @@ void
 gr_cooking_page_set_recipe (GrCookingPage *page,
                             GrRecipe      *recipe)
 {
-        if (g_set_object (&page->recipe, recipe)) {
-                g_autoptr(GArray) images = NULL;
-                const char *instructions = NULL;
+        g_autoptr(GArray) images = NULL;
+        const char *instructions = NULL;
 
-                g_object_get (recipe, "images", &images, NULL);
-                instructions = gr_recipe_get_translated_instructions (recipe);
+        g_set_object (&page->recipe, recipe);
 
-                gr_cooking_view_set_images (GR_COOKING_VIEW (page->cooking_view), images, 0);
-                gr_cooking_view_set_instructions (GR_COOKING_VIEW (page->cooking_view), instructions);
-        }
+        g_object_get (recipe, "images", &images, NULL);
+        instructions = gr_recipe_get_translated_instructions (recipe);
+
+        gr_cooking_view_set_images (GR_COOKING_VIEW (page->cooking_view), images, 0);
+        gr_cooking_view_set_instructions (GR_COOKING_VIEW (page->cooking_view), instructions);
 }
 


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