Ephoto: Fix issue where symlinked images may not show. Also fix issue where thumbs may get cleared but not repopulated.

This commit is contained in:
Stephen okra Houston 2016-08-09 09:26:41 -05:00
parent dd9a8ed7ce
commit d996dd64e3
4 changed files with 32 additions and 4 deletions

View File

@ -106,6 +106,7 @@ void ephoto_thumb_browser_update_info_label(Ephoto *ephoto);
void ephoto_thumb_browser_slideshow(Evas_Object *obj);
void ephoto_thumb_browser_paste(Ephoto *ephoto, Elm_Object_Item *item);
void ephoto_thumb_browser_clear(Ephoto *ephoto);
void ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_only);
/* smart callbacks called: "selected" - an item in the thumb browser is
* selected. The selected Ephoto_Entry is passed as event_info argument. */

View File

@ -274,9 +274,10 @@ _on_list_expanded(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
path = entry->path;
db->dirs_only = 0;
if (!strcmp(path, db->ephoto->config->directory))
{
db->dirs_only = 1;
else
db->dirs_only = 0;
ephoto_thumb_browser_dirs_only_set(db->ephoto, EINA_TRUE);
}
db->thumbs_only = 0;
ephoto_directory_set(db->ephoto, path, it, db->dirs_only, db->thumbs_only);
ephoto_title_set(db->ephoto, db->ephoto->config->directory);
@ -1040,6 +1041,7 @@ _ephoto_dir_populate_end(void *data, int type EINA_UNUSED,
return ECORE_CALLBACK_PASS_ON;
}
db->dirs_only = 0;
ephoto_thumb_browser_dirs_only_set(db->ephoto, EINA_FALSE);
db->thumbs_only = 0;
return ECORE_CALLBACK_PASS_ON;
@ -1052,6 +1054,7 @@ _ephoto_dir_populate_error(void *data, int type EINA_UNUSED,
Ephoto_Directory_Browser *db = data;
db->dirs_only = 0;
ephoto_thumb_browser_dirs_only_set(db->ephoto, EINA_FALSE);
db->thumbs_only = 0;
return ECORE_CALLBACK_PASS_ON;
@ -1269,6 +1272,8 @@ ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent)
db = calloc(1, sizeof(Ephoto_Directory_Browser));
EINA_SAFETY_ON_NULL_GOTO(db, error);
ephoto_thumb_browser_dirs_only_set(ephoto, EINA_FALSE);
_ephoto_dir_class = elm_genlist_item_class_new();
_ephoto_dir_class->item_style = "default";
_ephoto_dir_class->func.text_get = _dir_item_text_get;

View File

@ -753,7 +753,8 @@ _ephoto_populate_filter(void *data, Eio_File *handler EINA_UNUSED,
{
return EINA_TRUE;
}
else if (info->type == EINA_FILE_LNK && !ed->thumbs_only)
else if (info->type == EINA_FILE_LNK && ecore_file_is_dir(
ecore_file_realpath(info->path)))
{
return ecore_file_is_dir(ecore_file_realpath(info->path));
}

View File

@ -1336,6 +1336,9 @@ _ephoto_thumb_populate_start(void *data, int type EINA_UNUSED,
{
Ephoto_Thumb_Browser *tb = data;
if (tb->dirs_only)
return ECORE_CALLBACK_PASS_ON;
tb->animator.processed = 0;
tb->animator.count = 0;
if (tb->ephoto->selentries)
@ -1356,6 +1359,9 @@ _ephoto_thumb_populate_end(void *data, int type EINA_UNUSED,
{
Ephoto_Thumb_Browser *tb = data;
if (tb->dirs_only)
return ECORE_CALLBACK_PASS_ON;
tb->ls = NULL;
if (tb->main_deleted)
{
@ -1403,6 +1409,9 @@ _ephoto_thumb_populate_error(void *data, int type EINA_UNUSED,
{
Ephoto_Thumb_Browser *tb = data;
if (tb->dirs_only)
return ECORE_CALLBACK_PASS_ON;
tb->thumbs_only = 0;
tb->dirs_only = 0;
@ -1416,6 +1425,9 @@ _ephoto_thumb_entry_create(void *data, int type EINA_UNUSED, void *event)
Ephoto_Event_Entry_Create *ev = event;
Ephoto_Entry *e;
if (tb->dirs_only)
return ECORE_CALLBACK_PASS_ON;
e = ev->entry;
if (!e->is_dir && !ecore_file_is_dir(ecore_file_realpath(e->path)))
{
@ -1718,6 +1730,15 @@ _ephoto_main_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
/*Ephoto Thumb Browser Public Functions*/
void
ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_only)
{
Ephoto_Thumb_Browser *tb =
evas_object_data_get(ephoto->thumb_browser, "thumb_browser");
tb->dirs_only = dirs_only;
}
void
ephoto_thumb_browser_clear(Ephoto *ephoto)
{