{
struct appdata *ad = g_get_main_appdata();
griditem_t *newgi = NULL;
- Eina_List *igl = NULL;
+ //Eina_List *igl = NULL;
unsigned int igl_counter = 0;
newgi = malloc(sizeof(griditem_t));
newgi->itype = type;
- igl = elm_gengrid_items_get(ad->hig);
- igl_counter = eina_list_count(igl);
+ //igl = elm_gengrid_items_get(ad->hig);
+ //igl_counter = eina_list_count(igl);
fprintf(stderr, "## add - %d : %s\n", newgi->itype, idata);
if (type == GI_TEXT)
}
else //if (type == GI_IMAGE)
{
- Eina_List *l;
- Elm_Gengrid_Item *item;
+ //Eina_List *l;
+ Elm_Gengrid_Item *item = elm_gengrid_first_item_get(ad->hig);
griditem_t *ti = NULL;
if (!check_regular_file(idata))
return -1;
}
- EINA_LIST_FOREACH(igl, l, item)
+ while (item)
+ {
+ ti = elm_gengrid_item_data_get(item);
+ if ((ti->itype == type) && !strcmp(ti->ipathdata, idata))
+ {
+ DTRACE("Error : duplicated file path = %s\n", idata);
+ return -1;
+ }
+ item = elm_gengrid_item_next_get(item);
+ }
+
+ /*EINA_LIST_FOREACH(igl, l, item)
{
ti = elm_gengrid_item_data_get(item);
if ((ti->itype == type) && !strcmp(ti->ipathdata, idata))
DTRACE("Error : duplicated file path = %s\n", idata);
return -1;
}
- }
+ }*/
newgi->ipathdata = eina_stringshare_add(idata);
}
- if (igl_counter >= HISTORY_QUEUE_MAX_ITEMS)
+ /*if (igl_counter >= HISTORY_QUEUE_MAX_ITEMS)
{
// FIXME: add routine that is removing its elements
elm_gengrid_item_del(eina_list_data_get(eina_list_last(igl)));
- }
+ }*/
newgi->item = elm_gengrid_item_prepend(ad->hig, &gic, newgi, NULL, NULL);