summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2013-07-21 11:43:21 +0300
committerYakov Goldberg <yakov.g@samsung.com>2013-07-29 09:30:34 +0300
commitb1a35fddeff86efbaea2ac758b9d1890e12db5be (patch)
treeab1d0c5a732a73fdf6e6332d1b17c559a9a42c66
parent37e520ca846d344f80cf5de51f445415efbe4dc6 (diff)
downloadelementary-b1a35fddeff86efbaea2ac758b9d1890e12db5be.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.c43
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;