Fixing return of edje_edit_fonts_list_get
authorsachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 24 Aug 2010 14:36:07 +0000 (14:36 +0000)
committersachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 24 Aug 2010 14:36:07 +0000 (14:36 +0000)
The fuction was returning a private type (as
_Edje_Font_Directory_Entry) and an EAPI should *never*
return and private type.

By Fabiano Fidencio

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@51615 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_edit.c

index 0aaedb9..b7a7609 100644 (file)
@@ -3935,7 +3935,7 @@ edje_edit_fonts_list_get(Evas_Object *obj)
    if (!it) return NULL;
 
    EINA_ITERATOR_FOREACH(it, f)
-     fonts = eina_list_append(fonts, f);
+     fonts = eina_list_append(fonts, eina_stringshare_add(f->entry));
 
    eina_iterator_free(it);
 
@@ -6049,8 +6049,10 @@ _edje_generate_source(Evas_Object *obj)
    Eina_Strbuf *buf;
 
    Eina_List *l, *ll;
-   char *entry;
+   Eina_Iterator *it;
    Edje_Font_Directory_Entry *fnt;
+
+   char *entry;
    Eina_Bool ret = EINA_TRUE;
 
    GET_ED_OR_RETURN(NULL);
@@ -6097,23 +6099,24 @@ _edje_generate_source(Evas_Object *obj)
      }
 
    /* Fonts */
-   if ((ll = edje_edit_fonts_list_get(obj)))
+   it = eina_hash_iterator_data_new(ed->file->fonts);
+   if (it)
      {
-       BUF_APPEND(I0"fonts {\n");
+        BUF_APPEND(I0"fonts {\n");
 
-       EINA_LIST_FOREACH(ll, l, fnt)
-          BUF_APPENDF(I1"font: \"%s\" \"%s\";\n", fnt->file,
-                            fnt->entry);
+        EINA_ITERATOR_FOREACH(it, fnt)
+           BUF_APPENDF(I1"font: \"%s\" \"%s\";\n", fnt->file,
+                       fnt->entry);
 
-       BUF_APPEND(I0"}\n\n");
-       eina_list_free(ll);
+        BUF_APPEND(I0"}\n\n");
+        eina_list_free(ll);
 
-       if (!ret)
-         {
-            ERR("Generating EDC for Fonts");
-            eina_strbuf_free(buf);
-            return NULL;
-         }
+        if (!ret)
+          {
+             ERR("Generating EDC for Fonts");
+             eina_strbuf_free(buf);
+             return NULL;
+          }
      }
 
    /* Data */