yakov pushed a commit to branch master.

commit 4759f9e86c9708880f527da361cc8c2ba8a7a4e1
Author: Yakov Goldberg <[email protected]>
Date:   Sun Jul 21 11:43:21 2013 +0300

    fileselector: fix show filename in anchor for some cases
    
    Signed-off-by: Yakov Goldberg <[email protected]>
---
 src/lib/elc_fileselector.c | 43 ++++++++++++++++++-------------------------
 1 file changed, 18 insertions(+), 25 deletions(-)

diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 6669fb5..6013b26 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;

-- 

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to