cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=505491c47c7939e2fab2c2188a26ff5406f35fe5

commit 505491c47c7939e2fab2c2188a26ff5406f35fe5
Author: Jean Guyomarc'h <jean.guyoma...@gmail.com>
Date:   Wed Feb 3 15:23:34 2016 -0800

    edje: fix edje_file_data_get() when no collections are present
    
    Summary:
    edje_file_data_get() failed if the Edje file did not contain
    a collection (e.g. contained only data.item.
    This allows to load data from the file even when no collections
    are present, but only if specified.
    
    @fix
    
    Reviewers: raster, jpeg, stefan_schmidt, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3632
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/edje/edje_cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index ab8a9b4..526324e 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -259,7 +259,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
 }
 
 static Edje_File *
-_edje_file_open(const Eina_File *f, int *error_ret, time_t mtime)
+_edje_file_open(const Eina_File *f, int *error_ret, time_t mtime, Eina_Bool 
coll)
 {
    Edje_Color_Class *cc;
    Edje_Text_Class *tc;
@@ -292,7 +292,7 @@ _edje_file_open(const Eina_File *f, int *error_ret, time_t 
mtime)
         _edje_file_free(edf);
         return NULL;
      }
-   if (!edf->collection)
+   if (!edf->collection && coll)
      {
         *error_ret = EDJE_LOAD_ERROR_CORRUPT_FILE;
         _edje_file_free(edf);
@@ -384,7 +384,7 @@ find_list:
           }
      }
 
-   edf = _edje_file_open(file, error_ret, eina_file_mtime_get(file));
+   edf = _edje_file_open(file, error_ret, eina_file_mtime_get(file), !!coll);
    if (!edf) return NULL;
 
    eina_hash_direct_add(_edje_file_hash, &edf->f, edf);

-- 


Reply via email to