diff options
author | Vitalii Vorobiov <vi.vorobiov@samsung.com> | 2016-06-15 12:53:15 +0300 |
---|---|---|
committer | Vitalii Vorobiov <vi.vorobiov@samsung.com> | 2016-07-21 16:40:49 +0300 |
commit | 790e220967d3d8cde29eb2ab19c41a044c9b0242 (patch) | |
tree | 15387e1e6b414c43d7c92d23fc7fefdb22e0a977 | |
parent | cb0b10e239d6cd5466bd3034a6cf86d469b27602 (diff) | |
download | efl-790e220967d3d8cde29eb2ab19c41a044c9b0242.tar.gz |
edje_edit: save referenced groups when image id's are changed
@fix
-rw-r--r-- | src/lib/edje/edje_edit.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 1110f86b79..d45b5b4aa9 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -8882,6 +8882,7 @@ edje_edit_image_set_del(Evas_Object *obj, const char *name) { Edje_Image_Directory_Set *de = NULL, *de_last = NULL; Edje_Image_Directory_Set_Entry *dim = NULL; + Eet_File *eetf; unsigned int i, j, k; Eina_List *used; Eina_Iterator *it; @@ -8917,6 +8918,14 @@ edje_edit_image_set_del(Evas_Object *obj, const char *name) --ed->file->image_dir->sets_count; + /* open the eet file */ + eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); + if (!eetf) + { + ERR("Unable to open \"%s\" for writing output", ed->path); + return EINA_FALSE; + } + if (de_last->id != de->id) { Edje_Part *part; @@ -8951,6 +8960,11 @@ edje_edit_image_set_del(Evas_Object *obj, const char *name) } } } + if (!_edje_edit_collection_save(eetf, pce->ref)) + { + eet_close(eetf); + return EINA_FALSE; + } } eina_iterator_free(it); } @@ -8958,6 +8972,8 @@ edje_edit_image_set_del(Evas_Object *obj, const char *name) sizeof(Edje_Image_Directory_Set_Entry) * ed->file->image_dir->sets_count); + eet_close(eetf); + return EINA_TRUE; } @@ -9316,6 +9332,7 @@ edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name Eina_Iterator *it; Edje_Part_Collection_Directory_Entry *pce; Edje_Part *part; + Eet_File *eetf; Edje_Part_Description_Image *part_desc_image; unsigned int i, j, k; int image_id, new_image_id; @@ -9329,6 +9346,14 @@ edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name it = eina_hash_iterator_data_new(ed->file->collection); + /* open the eet file */ + eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE); + if (!eetf) + { + ERR("Unable to open \"%s\" for writing output", ed->path); + return EINA_FALSE; + } + EINA_ITERATOR_FOREACH(it, pce) { for (i = 0; i < pce->ref->parts_count; i++) @@ -9352,10 +9377,17 @@ edje_edit_image_replace(Evas_Object *obj, const char *name, const char *new_name part_desc_image->image.id = new_image_id; } } + if (!_edje_edit_collection_save(eetf, pce->ref)) + { + eet_close(eetf); + return EINA_FALSE; + } } } eina_iterator_free(it); + eet_close(eetf); + return EINA_TRUE; } @@ -9611,6 +9643,11 @@ edje_edit_image_del(Evas_Object *obj, const char *name) } } } + if (!_edje_edit_collection_save(eetf, pce->ref)) + { + eet_close(eetf); + return EINA_FALSE; + } } eina_iterator_free(it); } |