aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Houston <smhouston88@gmail.com>2017-09-26 11:53:13 -0500
committerStephen Houston <smhouston88@gmail.com>2017-09-26 11:53:29 -0500
commit9ca0e7ad9be7533196cf8f23f8984b8440d2c853 (patch)
tree166bc9c042f38d90264d0ccc1c7a56d7be5c5c54
parentEphoto Directory Browser: Add an item for the top directory. (diff)
downloadephoto-9ca0e7ad9be7533196cf8f23f8984b8440d2c853.tar.gz
Ephoto: Fix directory tree structure initialization.
-rw-r--r--src/bin/ephoto.h2
-rw-r--r--src/bin/ephoto_config.c2
-rw-r--r--src/bin/ephoto_directory_browser.c10
-rw-r--r--src/bin/ephoto_main.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h
index b3bd8aa..8e69c1b 100644
--- a/src/bin/ephoto.h
+++ b/src/bin/ephoto.h
@@ -110,7 +110,7 @@ void ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_o
/*directory browser functions*/
Evas_Object *ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent);
-void ephoto_directory_browser_initialize_structure(Ephoto *ephoto);
+void ephoto_directory_browser_initialize_structure(Ephoto *ephoto, char *rp);
void ephoto_directory_browser_top_dir_set(Ephoto *ephoto, const char *dir);
void ephoto_directory_browser_clear(Ephoto *ephoto);
diff --git a/src/bin/ephoto_config.c b/src/bin/ephoto_config.c
index 892333d..7e75aa5 100644
--- a/src/bin/ephoto_config.c
+++ b/src/bin/ephoto_config.c
@@ -35,7 +35,7 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED,
ephoto_thumb_browser_clear(ephoto);
eina_stringshare_replace(&ephoto->config->directory, rp);
ephoto_directory_browser_top_dir_set(ephoto, ephoto->config->directory);
- ephoto_directory_browser_initialize_structure(ephoto);
+ ephoto_directory_browser_initialize_structure(ephoto, rp);
free(rp);
}
ephoto->config->prompts = elm_check_state_get(ephoto->config->show_prompts);
diff --git a/src/bin/ephoto_directory_browser.c b/src/bin/ephoto_directory_browser.c
index d324215..eb0ffb5 100644
--- a/src/bin/ephoto_directory_browser.c
+++ b/src/bin/ephoto_directory_browser.c
@@ -523,7 +523,7 @@ _fsel_menu_go_root(void *data, Evas_Object *obj EINA_UNUSED, void *event_data EI
ephoto_thumb_browser_clear(ephoto);
eina_stringshare_replace(&ephoto->config->directory, rp);
ephoto_directory_browser_top_dir_set(ephoto, ephoto->config->directory);
- ephoto_directory_browser_initialize_structure(ephoto);
+ ephoto_directory_browser_initialize_structure(ephoto, rp);
free(rp);
}
@@ -538,7 +538,7 @@ _fsel_menu_go_home(void *data, Evas_Object *obj EINA_UNUSED, void *event_data EI
ephoto_thumb_browser_clear(ephoto);
eina_stringshare_replace(&ephoto->config->directory, rp);
ephoto_directory_browser_top_dir_set(ephoto, ephoto->config->directory);
- ephoto_directory_browser_initialize_structure(ephoto);
+ ephoto_directory_browser_initialize_structure(ephoto, rp);
free(rp);
}
@@ -1226,7 +1226,7 @@ ephoto_directory_browser_top_dir_set(Ephoto *ephoto, const char *dir)
}
void
-ephoto_directory_browser_initialize_structure(Ephoto *ephoto)
+ephoto_directory_browser_initialize_structure(Ephoto *ephoto, char *rp)
{
Ephoto_Directory_Browser *db =
evas_object_data_get(ephoto->dir_browser, "directory_browser");
@@ -1259,8 +1259,8 @@ ephoto_directory_browser_initialize_structure(Ephoto *ephoto)
dir = NULL;
}
}
- snprintf(top, PATH_MAX, "%s", ephoto->config->open);
- tentry = ephoto_entry_new(ephoto, ephoto->config->open, basename(top),
+ snprintf(top, PATH_MAX, "%s", rp);
+ tentry = ephoto_entry_new(ephoto, rp, basename(top),
EINA_FILE_DIR);
tentry->parent = NULL;
tic = _ephoto_dir_tree_class;
diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c
index ca7641e..b8c0054 100644
--- a/src/bin/ephoto_main.c
+++ b/src/bin/ephoto_main.c
@@ -609,7 +609,7 @@ ephoto_window_add(const char *path)
ephoto->trash_path = eina_stringshare_add(trash);
ephoto_directory_browser_top_dir_set(ephoto, ephoto->config->directory);
- ephoto_directory_browser_initialize_structure(ephoto);
+ ephoto_directory_browser_initialize_structure(ephoto, (char *)ephoto->config->open);
evas_object_resize(ephoto->win, ephoto->config->window_width,
ephoto->config->window_height);
evas_object_show(ephoto->win);