static void
_monitoring_start(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *model)
{
+ if (sd->monitoring) return ;
sd->monitoring = EINA_TRUE;
efl_event_callback_array_add(model, monitoring_callbacks(), fs);
}
static void
_monitoring_stop(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *model)
{
+ if (!sd->monitoring) return ;
sd->monitoring = EINA_FALSE;
efl_event_callback_array_del(model, monitoring_callbacks(), fs);
}
static void
_elm_fileselector_replace_model(Elm_Fileselector *fs, Elm_Fileselector_Data *sd, Efl_Model *model, const char *path)
{
- if (sd->model)
- _monitoring_stop(fs, sd, sd->model);
+ _monitoring_stop(fs, sd, sd->model);
efl_replace(&sd->model, model);
eina_stringshare_replace(&sd->path, path);
{
struct sel_data *sdata = data;
ELM_FILESELECTOR_DATA_GET(sdata->fs, sd);
+
_populate(sdata->fs, sdata->model, NULL, sdata->selected);
efl_replace(&sdata->model, NULL);
efl_replace(&sdata->selected, NULL);
if (!sd->double_tap_navigation) return;
+ efl_parent_set(it_data->model, data);
_schedule_populate(data, sd, it_data->model, NULL);
}
if (sd->double_tap_navigation) return;
+ // Take ownership of the model, to keep it alive
+ efl_parent_set(it_data->model, data);
_schedule_populate(data, sd, it_data->model, NULL);
}