[recipes] recipe store: Stop loading and saving DarkText



commit 9530fd6f41517030d64a7f7b95f28f53d9f1a18a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 4 23:02:49 2017 +0000

    recipe store: Stop loading and saving DarkText
    
    It is not used anymore.

 src/gr-image-viewer.c    |    2 --
 src/gr-images.c          |    1 -
 src/gr-images.h          |    1 -
 src/gr-recipe-exporter.c |    1 -
 src/gr-recipe-importer.c |    1 -
 src/gr-recipe-store.c    |   19 -------------------
 6 files changed, 0 insertions(+), 25 deletions(-)
---
diff --git a/src/gr-image-viewer.c b/src/gr-image-viewer.c
index d7b5833..490dd96 100644
--- a/src/gr-image-viewer.c
+++ b/src/gr-image-viewer.c
@@ -358,7 +358,6 @@ image_received (GtkClipboard *clipboard,
 
                 ri.path = g_strdup (path);
                 ri.angle = 0;
-                ri.dark_text = FALSE;
 
                 add_image (viewer, &ri, TRUE);
         }
@@ -545,7 +544,6 @@ file_chooser_response (GtkNativeDialog *self,
 
                         ri.path = g_strdup (l->data);
                         ri.angle = 0;
-                        ri.dark_text = FALSE;
 
                         add_image (viewer, &ri, TRUE);
 
diff --git a/src/gr-images.c b/src/gr-images.c
index d414eec..03fc9fb 100644
--- a/src/gr-images.c
+++ b/src/gr-images.c
@@ -29,7 +29,6 @@ gr_rotated_image_clear (gpointer data)
 
         g_clear_pointer (&image->path, g_free);
         image->angle = 0;
-        image->dark_text = FALSE;
 }
 
 GArray *
diff --git a/src/gr-images.h b/src/gr-images.h
index d6a1492..ede4e4c 100644
--- a/src/gr-images.h
+++ b/src/gr-images.h
@@ -27,7 +27,6 @@ G_BEGIN_DECLS
 typedef struct {
         char *path;
         int angle;
-        gboolean dark_text;
 } GrRotatedImage;
 
 GArray *gr_rotated_image_array_new (void);
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index 1641ba9..9a6e896 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -227,7 +227,6 @@ export_one_recipe (GrRecipeExporter  *exporter,
 
                 paths[j] = g_strdup (basename);
                 angles[j] = ri->angle;
-                dark[j] = ri->dark_text;
 
                 j++;
         }
diff --git a/src/gr-recipe-importer.c b/src/gr-recipe-importer.c
index c8215c7..b41ffb6 100644
--- a/src/gr-recipe-importer.c
+++ b/src/gr-recipe-importer.c
@@ -310,7 +310,6 @@ import_recipe (GrRecipeImporter *importer)
 
                         ri.path = new_path;
                         ri.angle = importer->recipe_angles[i];
-                        ri.dark_text = importer->recipe_dark[i];
                         g_array_append_val (images, ri);
                 }
         }
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index c7d246e..66095d1 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -118,7 +118,6 @@ load_recipes (GrRecipeStore *self,
                 g_autofree char *image_path = NULL;
                 g_auto(GStrv) paths = NULL;
                 g_autofree int *angles = NULL;
-                g_autofree gboolean *dark = NULL;
                 int serves;
                 int spiciness;
                 int default_image = 0;
@@ -258,18 +257,6 @@ load_recipes (GrRecipeStore *self,
                         }
                         g_clear_error (&error);
                 }
-                dark = g_key_file_get_boolean_list (keyfile, groups[i], "DarkText", &length3, &error);
-                if (error) {
-                        if (!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
-                                g_warning ("Failed to load recipe %s: %s", groups[i], error->message);
-                                continue;
-                        }
-                        g_clear_error (&error);
-                }
-                if (length2 != length3) {
-                        g_warning ("Failed to load recipe %s: Images and DarkText length mismatch", 
groups[i]);
-                        continue;
-                }
                 serves = g_key_file_get_integer (keyfile, groups[i], "Serves", &error);
                 if (error) {
                         if (!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
@@ -315,14 +302,12 @@ load_recipes (GrRecipeStore *self,
                         for (j = 0; paths[j]; j++) {
                                 ri.path = g_strdup (paths[j]);
                                 ri.angle = angles[j];
-                                ri.dark_text = dark[j];
                                 g_array_append_val (images, ri);
                         }
                 }
                 else if (image_path) {
                         ri.path = g_strdup (image_path);
                         ri.angle = 0;
-                        ri.dark_text = FALSE;
                         g_array_append_val (images, ri);
                 }
 
@@ -459,7 +444,6 @@ save_recipes (GrRecipeStore *self)
                 GrDiets diets;
                 g_auto(GStrv) paths = NULL;
                 g_autofree int *angles = NULL;
-                g_autofree gboolean *dark = NULL;
                 GDateTime *ctime;
                 GDateTime *mtime;
                 int default_image = 0;
@@ -490,7 +474,6 @@ save_recipes (GrRecipeStore *self)
                 tmp = get_user_data_dir ();
                 paths = g_new0 (char *, images->len + 1);
                 angles = g_new0 (int, images->len + 1);
-                dark = g_new0 (gboolean, images->len + 1);
                 for (i = 0; i < images->len; i++) {
                         GrRotatedImage *ri = &g_array_index (images, GrRotatedImage, i);
                         if (g_str_has_prefix (ri->path, tmp))
@@ -498,7 +481,6 @@ save_recipes (GrRecipeStore *self)
                         else
                                 paths[i] = g_strdup (ri->path);
                         angles[i] = ri->angle;
-                        dark[i] = ri->dark_text;
                 }
 
                 // For readonly recipes, we just store notes
@@ -524,7 +506,6 @@ save_recipes (GrRecipeStore *self)
                 g_key_file_set_integer (keyfile, key, "DefaultImage", default_image);
                 g_key_file_set_string_list (keyfile, key, "Images", (const char * const *)paths, 
images->len);
                 g_key_file_set_integer_list (keyfile, key, "Angles", angles, images->len);
-                g_key_file_set_integer_list (keyfile, key, "DarkText", dark, images->len);
                 if (ctime) {
                         g_autofree char *created = date_time_to_string (ctime);
                         g_key_file_set_string (keyfile, key, "Created", created);


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