forked from enlightenment/edi
filepanel: correctly look up files within their dir
Avoid duplication even when multiple files have the same name
This commit is contained in:
parent
65dc251098
commit
5d104b38f2
|
@ -352,7 +352,11 @@ _file_listing_item_insert(const char *path, Eina_Bool isdir, Elm_Object_Item *pa
|
||||||
{
|
{
|
||||||
Elm_Genlist_Item_Class *clas = &itc;
|
Elm_Genlist_Item_Class *clas = &itc;
|
||||||
Edi_Dir_Data *sd;
|
Edi_Dir_Data *sd;
|
||||||
Elm_Object_Item *it;
|
Elm_Object_Item *item;
|
||||||
|
|
||||||
|
item = _file_listing_item_find(path, parent_it);
|
||||||
|
if (item)
|
||||||
|
return;
|
||||||
|
|
||||||
sd = calloc(1, sizeof(Edi_Dir_Data));
|
sd = calloc(1, sizeof(Edi_Dir_Data));
|
||||||
if (isdir)
|
if (isdir)
|
||||||
|
@ -362,10 +366,6 @@ _file_listing_item_insert(const char *path, Eina_Bool isdir, Elm_Object_Item *pa
|
||||||
}
|
}
|
||||||
|
|
||||||
sd->path = eina_stringshare_add(path);
|
sd->path = eina_stringshare_add(path);
|
||||||
it = elm_genlist_search_by_text_item_get(list, NULL, "elm.text",
|
|
||||||
basename((char *)sd->path),
|
|
||||||
ELM_GLOB_MATCH_NO_ESCAPE);
|
|
||||||
if (it) return;
|
|
||||||
|
|
||||||
(void)!elm_genlist_item_sorted_insert(list, clas, sd, parent_it,
|
(void)!elm_genlist_item_sorted_insert(list, clas, sd, parent_it,
|
||||||
isdir ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
|
isdir ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
|
||||||
|
|
Loading…
Reference in New Issue