fix typop no longer working for still images. Add some error messages

Thanks to dassify for noticing
This commit is contained in:
Boris Faure 2015-09-04 20:30:29 +02:00
parent 4c00bec4d6
commit 6f898d5ebe
1 changed files with 26 additions and 7 deletions

View File

@ -320,7 +320,7 @@ _type_img_anim_handle(Evas_Object *obj)
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, -1);
if (!evas_object_image_animated_get(sd->o_img))
return -1;
return 0;
sd->fr = 1;
sd->frnum = evas_object_image_animated_frame_count_get(sd->o_img);
@ -1171,7 +1171,11 @@ media_add(Evas_Object *parent, const char *src, const Config *config, int mode,
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
e = evas_object_evas_get(parent);
if (!e) return NULL;
if (!e)
{
ERR("can not get evas");
return NULL;
}
if (!_smart) _smart_init();
obj = evas_object_smart_add(e, _smart);
@ -1304,27 +1308,42 @@ media_add(Evas_Object *parent, const char *src, const Config *config, int mode,
{
// XXX: handle sd->url being true?
if (_type_thumb_init(obj) < 0)
{
ERR("failed to init '%s'", src);
goto err;
}
}
else
{
switch (type)
{
case MEDIA_TYPE_IMG:
if (!sd->url && (_type_img_init(obj) < 0))
{
ERR("failed to init '%s'", src);
goto err;
}
break;
case MEDIA_TYPE_SCALE:
if (!sd->url && (_type_scale_init(obj) < 0))
{
ERR("failed to init '%s'", src);
goto err;
}
break;
case MEDIA_TYPE_EDJE:
if (!sd->url && (_type_edje_init(obj) < 0))
{
ERR("failed to init '%s'", src);
goto err;
}
break;
case MEDIA_TYPE_MOV:
if (!sd->url && (_type_mov_init(obj) < 0))
{
ERR("failed to init '%s'", src);
goto err;
}
break;
default:
break;