forked from enlightenment/efl
Fixing {font,image}_del's ret when file not exist
When a file not exist, now, we're returning EINA_FALSE. It's according with eina_hash_del()'s behavior. By Fabiano Fidencio SVN revision: 51614
This commit is contained in:
parent
1f0b19c4b4
commit
42b3ccd05a
|
@ -2288,7 +2288,8 @@ EAPI Eina_Bool edje_edit_font_add(Evas_Object *obj, const char *path, const char
|
|||
* @param obj Object being edited.
|
||||
* @param alias The font alias
|
||||
*
|
||||
* @return EINA_TRUE if font deleted, EINA_FALSE otherwise.
|
||||
* @return EINA_TRUE if succesful, EINA_FALSE otherwise (including the
|
||||
* case when the alias is not valid).
|
||||
*/
|
||||
EAPI Eina_Bool edje_edit_font_del(Evas_Object *obj, const char* alias);
|
||||
|
||||
|
@ -2358,7 +2359,8 @@ EAPI Eina_Bool edje_edit_image_add(Evas_Object *obj, const char *path);
|
|||
* @param obj Object being edited.
|
||||
* @param name The name of the image file to include in the edje.
|
||||
*
|
||||
* @return EINA_TRUE if succesful, EINA_FALSE otherwise.
|
||||
* @return EINA_TRUE if succesful, EINA_FALSE otherwise (including the
|
||||
* case when the name is not valid).
|
||||
*/
|
||||
EAPI Eina_Bool edje_edit_image_del(Evas_Object *obj, const char *name);
|
||||
|
||||
|
|
|
@ -4024,7 +4024,7 @@ edje_edit_font_del(Evas_Object *obj, const char* alias)
|
|||
if (!fnt)
|
||||
{
|
||||
WRN("Unable to find font entry part \"%s\"", alias);
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
/* Erase font to edje file */
|
||||
|
@ -4226,6 +4226,8 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
|||
|
||||
/* Create Image_Directory if not exist */
|
||||
if (!ed->file->image_dir)
|
||||
goto invalid_image;
|
||||
|
||||
return EINA_TRUE;
|
||||
|
||||
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||
|
@ -4238,10 +4240,7 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
|||
}
|
||||
|
||||
if (i == ed->file->image_dir->entries_count)
|
||||
{
|
||||
WRN("Unable to find image entry part \"%s\"", name);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
goto invalid_image;
|
||||
|
||||
{
|
||||
char entry[PATH_MAX];
|
||||
|
@ -4278,6 +4277,10 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
|||
de->entry = NULL;
|
||||
|
||||
return EINA_TRUE;
|
||||
|
||||
invalid_image:
|
||||
WRN("Unable to find image entry part \"%s\"", name);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
|
Loading…
Reference in New Issue