file2 = efl_vpath_file_result_get(ed->file_obj);
f = eina_file_open(file2, EINA_FALSE);
+ if ((ed->file_obj) && (!efl_vpath_file_keep_get(ed->file_obj)))
+ {
+ efl_del(ed->file_obj);
+ ed->file_obj = NULL;
+ }
if (!f)
{
efl_del(ed->file_obj);
}
}
}
+ // XXX: handle file:// urls locally...
+ // XXX: if its a remote url or zip file etc. where we need to
+ // keep tmp file around then we need to set keep to true
+ // efl_vpath_file_keept_set(file, EINA_TRUE);
+
// file:/// <- local file path uri
// file://localhost/ <- local file path uri
// file://hostname/ <- remove file path uri
const char *path;
const char *result;
Eina_Bool called : 1;
+ Eina_Bool keep : 1;
};
EOLIAN static void
return pd->result;
}
+EOLIAN static void
+_efl_vpath_file_keep_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, Eina_Bool keep)
+{
+ pd->keep = keep;
+}
+
+EOLIAN static Eina_Bool
+_efl_vpath_file_keep_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd)
+{
+ return pd->keep;
+}
+
EOLIAN static Eina_Bool
_efl_vpath_file_do(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd)
{
path: string; [[ The resulting destination file ]]
}
}
+ @property keep {
+ [[ If this object has to be kept for the usage of the result ]]
+ set {}
+ get {}
+ values {
+ keep: bool; [[ If the object neerds tobe kept around ]]
+ }
+ }
do {
[[ Actually begin the resolving here - emit event now or do later ]]
return: bool; [[ Result callback already called ]]
Ecore_Job *job;
+ Efl_Vpath_File *file_obj;
+
const char *title;
#ifdef HAVE_EIO
sd->save_xattr = NULL;
#endif
+ if (sd->file_obj)
+ {
+ efl_del(sd->file_obj);
+ sd->file_obj = NULL;
+ }
if (sd->engine_instance)
{
emotion_engine_instance_file_close(sd->engine_instance);
sd->video.h = 0;
if ((file) && (file[0] != 0))
{
- const char *file2;
+ const char *file2 = NULL;
eina_stringshare_replace(&sd->file, file);
emotion_engine_instance_file_close(sd->engine_instance);
_emotion_image_data_zero(sd->obj);
sd->open = 0;
- Efl_Vpath_File *file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file);
- efl_vpath_file_do(file_obj);
- // XXX:FIXME: allow this to be async
- efl_vpath_file_wait(file_obj);
- file2 = efl_vpath_file_result_get(file_obj);
+ if (sd->file_obj)
+ {
+ efl_del(sd->file_obj);
+ sd->file_obj = NULL;
+ }
+ if (file)
+ {
+ sd->file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file);
+ efl_vpath_file_do(sd->file_obj);
+ // XXX:FIXME: allow this to be async
+ efl_vpath_file_wait(sd->file_obj);
+ file2 = efl_vpath_file_result_get(sd->file_obj);
+ }
if (!emotion_engine_instance_file_open(sd->engine_instance, file2))
{
WRN("Couldn't open file=%s", sd->file);
- efl_del(file_obj);
+ if (sd->file_obj)
+ {
+ efl_del(sd->file_obj);
+ sd->file_obj = NULL;
+ }
return EINA_FALSE;
}
- efl_del(file_obj);
+ if ((sd->file_obj) && (!efl_vpath_file_keep_get(sd->file_obj)))
+ {
+ efl_del(sd->file_obj);
+ sd->file_obj = NULL;
+ }
DBG("successfully opened file=%s", sd->file);
sd->pos = 0.0;
if (sd->play) emotion_engine_instance_play(sd->engine_instance, 0.0);
evas_object_async_block(obj);
_evas_image_init_set(NULL, file, key, eo_obj, obj, o, &lo);
+ if (o->file_obj) efl_del(o->file_obj);
+ o->file_obj = NULL;
file2 = o->cur->u.file;
if (file2)
{
o->engine_data = ENFN->image_load(ENDT, file2, o->cur->key, &o->load_error, &lo);
o->buffer_data_set = EINA_FALSE;
_evas_image_done_set(eo_obj, obj, o);
-
+ if ((o->file_obj) && (!efl_vpath_file_keep_get(o->file_obj)))
+ {
+ efl_del(o->file_obj);
+ o->file_obj = NULL;
+ }
return EINA_TRUE;
}
{
const char *file2 = o->cur->u.file;
+ if (o->file_obj) efl_del(o->file_obj);
+ o->file_obj = NULL;
if (file2)
{
o->file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file2);
file2 = efl_vpath_file_result_get(o->file_obj);
}
o->engine_data = ENFN->image_load(ENDT, file2, o->cur->key, &o->load_error, &lo);
+ if ((o->file_obj) && (!efl_vpath_file_keep_get(o->file_obj)))
+ {
+ efl_del(o->file_obj);
+ o->file_obj = NULL;
+ }
}
if (o->engine_data)