diff options
author | Yakov Goldberg <yakov.g@samsung.com> | 2013-07-21 11:43:21 +0300 |
---|---|---|
committer | Yakov Goldberg <yakov.g@samsung.com> | 2013-08-06 11:17:40 +0300 |
commit | 4759f9e86c9708880f527da361cc8c2ba8a7a4e1 (patch) | |
tree | 7e9b661195510258cec181efd507c8b5e3436fee | |
parent | 92840e8242b058902ce151ef33dd80b862b4856e (diff) | |
download | elementary-4759f9e86c9708880f527da361cc8c2ba8a7a4e1.tar.gz |
fileselector: fix show filename in anchor for some cases
Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
-rw-r--r-- | src/lib/elc_fileselector.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 6669fb51f..6013b260a 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -616,41 +616,34 @@ _sel_do(void *data) struct sel_data *sdata = data; const char *path; const char *p; + Eina_Bool is_dir; ELM_FILESELECTOR_DATA_GET(sdata->fs, sd); path = sdata->path; + is_dir = ecore_file_is_dir(path); - if ((!sd->only_folder) && ecore_file_is_dir(path)) + /* We need to populate, if path is directory and: + * - mode is GRID; + * - mode is LIST and 'not expand mode'; + * in other cases update anchors. */ + if (((!sd->expand) || (sd->mode == ELM_FILESELECTOR_GRID)) && (is_dir)) { - if (sd->expand && sd->mode == ELM_FILESELECTOR_LIST) - { - _anchors_do(sdata->fs, path); - } - else - { - /* keep a ref to path 'couse it will be destroyed by _populate */ - p = eina_stringshare_add(path); - _populate(sdata->fs, p, NULL); - eina_stringshare_del(p); - } - goto end; + /* keep a ref to path 'couse it will be destroyed by _populate */ + p = eina_stringshare_add(path); + _populate(sdata->fs, p, NULL); + eina_stringshare_del(p); } - else /* navigating through folders only or file is not a dir. */ + else { - if (sd->expand && sd->mode == ELM_FILESELECTOR_LIST) - _anchors_do(sdata->fs, path); - else if (sd->only_folder) - { - /* keep a ref to path 'couse it will be destroyed by _populate */ - p = eina_stringshare_add(path); - _populate(sdata->fs, p, NULL); - eina_stringshare_del(p); - } + _anchors_do(sdata->fs, path); } - evas_object_smart_callback_call(sdata->fs, SIG_SELECTED, (void *)path); + /* We need to send callback when: + * - path is dir and mode is ONLY FOLDER + * - path is file and mode is NOT ONLY FOLDER */ + if (is_dir == sd->only_folder) + evas_object_smart_callback_call(sdata->fs, SIG_SELECTED, (void *)path); -end: sd->sel_idler = NULL; free(sdata); return ECORE_CALLBACK_CANCEL; |