elementary: make sure that the model parent being used is always the fileselector.

Model provided by an item selection would have there parent being the current
model of the fileselector. Once that one is replaced by the item model, it would
automatically invalidate the model and break any further request. This lead to
a bug where you could only get into one directory before everything else
being empty.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8450
This commit is contained in:
Cedric BAIL 2019-03-22 11:20:51 -07:00
parent 1eb49b2e9b
commit 8ab3f3319e
1 changed files with 6 additions and 5 deletions

View File

@ -1131,6 +1131,7 @@ _on_item_activated(void *data, const Efl_Event *event)
if (!sd->double_tap_navigation) return;
efl_parent_set(it_data->model, data);
_schedule_populate(data, sd, it_data->model, NULL);
}
@ -1350,7 +1351,7 @@ _current_filter_changed(void *data,
}
static void
_ok(void *data, const Efl_Event *event)
_ok(void *data, const Efl_Event *event EINA_UNUSED)
{
const char *name;
const char *selection = NULL;
@ -1373,7 +1374,7 @@ _ok(void *data, const Efl_Event *event)
else
selection = eina_stringshare_printf("%s/%s", sd->path, name);
selected_model = efl_add_ref(efl_class_get(sd->model), event->object,
selected_model = efl_add_ref(efl_class_get(sd->model), fs,
efl_event_callback_array_add(efl_added, noref_death(), NULL),
efl_io_model_path_set(efl_added, selection));
@ -1428,7 +1429,7 @@ _on_text_activated(void *data, const Efl_Event *event)
if (!ecore_file_is_dir(path))
{
model = efl_add_ref(efl_class_get(sd->model), event->object,
model = efl_add_ref(efl_class_get(sd->model), fs,
efl_io_model_path_set(efl_added, path),
efl_event_callback_array_add(efl_added, noref_death(), NULL));
@ -1439,7 +1440,7 @@ _on_text_activated(void *data, const Efl_Event *event)
dir = EINA_TRUE;
}
parent = efl_add_ref(efl_class_get(sd->model), event->object,
parent = efl_add_ref(efl_class_get(sd->model), fs,
efl_io_model_path_set(efl_added, path),
efl_event_callback_array_add(efl_added, noref_death(), NULL));
if (!parent) goto end;
@ -1493,7 +1494,7 @@ _anchor_clicked(void *data, const Efl_Event *event)
if (!sd->model) return;
model = efl_add_ref(efl_class_get(sd->model), event->object,
model = efl_add_ref(efl_class_get(sd->model), fs,
efl_event_callback_array_add(efl_added, noref_death(), NULL),
efl_io_model_path_set(efl_added, info->name));
if (!model) return;