[recipes] Revert "Populate cuisine combobox with all the cuisines"



commit de938fb17df894c663e1cf15c0c2b3af030bd086
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Mar 28 19:24:31 2017 +0100

    Revert "Populate cuisine combobox with all the cuisines"
    
    This reverts commit ac868b2479683919ffea4eea73f0004cf1e629c8.
    
    didn't mean to push this yet.

 src/gr-edit-page.c |   27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)
---
diff --git a/src/gr-edit-page.c b/src/gr-edit-page.c
index f1ae294..3b583bd 100644
--- a/src/gr-edit-page.c
+++ b/src/gr-edit-page.c
@@ -366,26 +366,17 @@ edit_page_finalize (GObject *object)
 static void
 populate_cuisine_combo (GrEditPage *page)
 {
-        GArray *cuisine_names = g_array_new (FALSE, TRUE, sizeof (char *));
-        g_autofree char **names = NULL;
-        guint length;
+        const char **names;
         const char *title;
+        int length;
         int i;
-        GrRecipeStore *store;
 
-        store = gr_recipe_store_get ();
-        names = gr_recipe_store_get_all_cuisines (store, &length);
-        gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (page->cuisine_combo));
-
-        for (i = 0; i < length; ++i) {
-                char *temp_cuisine_name;
-                cuisine_names = g_array_append_val (cuisine_names, names[i]);
-                temp_cuisine_name = g_strstrip (g_array_index (cuisine_names, char *, i));
-                if (strcmp (temp_cuisine_name, "") != 0) {
-                        gr_cuisine_get_data (temp_cuisine_name, &title, NULL, NULL);
-                        gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (page->cuisine_combo),
-                                                                       temp_cuisine_name, title);
-                }
+        names = gr_cuisine_get_names (&length);
+        for (i = 0; i < length; i++) {
+                gr_cuisine_get_data (names[i], &title, NULL, NULL);
+                gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (page->cuisine_combo),
+                                           names[i],
+                                           title);
         }
 }
 
@@ -2314,7 +2305,7 @@ gr_edit_page_save (GrEditPage *page)
                 if (ret)
                         g_set_object (&page->recipe, recipe);
         }
-        populate_cuisine_combo (page);
+
         if (ret) {
                 gr_image_viewer_persist_changes (GR_IMAGE_VIEWER (page->images));
 


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