okra pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=79642b9350e4653cdfbf4996a3c54b39a7ed8802

commit 79642b9350e4653cdfbf4996a3c54b39a7ed8802
Author: Stephen Houston <smhousto...@gmail.com>
Date:   Tue Nov 3 08:07:32 2015 -0600

    Ephoto: Fix bug on start where no directory is defined.  Fix file tree.
---
 src/bin/ephoto_main.c          | 15 +++++++++------
 src/bin/ephoto_thumb_browser.c | 19 +++++++++++++------
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c
index 878e78b..2426fac 100644
--- a/src/bin/ephoto_main.c
+++ b/src/bin/ephoto_main.c
@@ -231,12 +231,15 @@ ephoto_window_add(const char *path)
 
    if ((!path) || (!ecore_file_exists(path)))
      {
-        if (!strcmp(ephoto->config->open, "Last"))
-          path = ephoto->config->directory;
-        else
-          path = ephoto->config->open;
-        if ((path) && (!ecore_file_exists(path))) path = NULL;
-        if (!path)
+        if (ephoto->config->open)
+          {
+             if (!strcmp(ephoto->config->open, "Last"))
+               path = ephoto->config->directory;
+             else
+               path = ephoto->config->open;
+             if ((path) && (!ecore_file_exists(path))) path = NULL;
+          }
+        else if (!ephoto->config->open || path)
           {
              if (getcwd(buf, sizeof(buf)))
                path = buf;
diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c
index ab3c286..55beb3f 100644
--- a/src/bin/ephoto_thumb_browser.c
+++ b/src/bin/ephoto_thumb_browser.c
@@ -38,6 +38,7 @@ struct _Ephoto_Thumb_Browser
    Eina_List *todo_items;
    Eina_List *grid_items;
    Eina_List *handlers;
+   int contracted;
    int totimages;
    double totsize;
    struct {
@@ -90,10 +91,13 @@ _on_list_contracted(void *data, Evas_Object *obj 
EINA_UNUSED, void *event_info)
    Ephoto_Thumb_Browser *tb = data;
    Elm_Widget_Item *it = event_info;
    const char *path = elm_object_item_data_get(it);
+   char p[PATH_MAX];
 
+   snprintf(p, PATH_MAX, "%s", tb->ephoto->config->directory);
    elm_genlist_item_subitems_clear(it);
-   ephoto_directory_set(tb->ephoto, path);
-   ephoto_title_set(tb->ephoto, path);
+   tb->contracted = 1;
+   ephoto_directory_set(tb->ephoto, dirname(p));
+   ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
 }
 
 static void
@@ -226,20 +230,22 @@ _todo_items_process(void *data)
 
    EINA_LIST_FREE(tb->todo_items, entry)
      {
-        if (entry->is_dir)
+        if (!tb->contracted && entry->is_dir)
           {
              if (tb->fsel_parent)
                _entry_dir_item_add(tb, entry, tb->fsel_parent);
              else
                _entry_dir_item_add(tb, entry, NULL);
           }
-        else
+        else if (!entry->is_dir)
           _entry_thumb_item_add(tb, entry);
      }
 
    if (!tb->animator.todo_items)
-     tb->fsel_parent = NULL;
-
+     {
+        tb->fsel_parent = NULL;
+        tb->contracted = 0;
+     }
    return EINA_FALSE;
 }
 
@@ -882,6 +888,7 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object 
*parent)
    _ephoto_dir_class.func.del = _ephoto_dir_item_del;
 
    tb->ephoto = ephoto;
+   tb->contracted = 0;
    tb->main = box;
    elm_box_horizontal_set(tb->main, EINA_TRUE);
    evas_object_size_hint_weight_set(tb->main, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);

-- 


Reply via email to