diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index 75d3a15..74f581d 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -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. */ diff --git a/src/bin/ephoto_directory_browser.c b/src/bin/ephoto_directory_browser.c index bfb659e..89356e3 100644 --- a/src/bin/ephoto_directory_browser.c +++ b/src/bin/ephoto_directory_browser.c @@ -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; + { + db->dirs_only = 1; + 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; diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index 8c08ed8..cb5c54f 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -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)); } diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 1b8684c..4894870 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -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) {