Ephoto: Fix directory tree structure initialization.

master
Stephen Houston 5 years ago
parent 8a3cc811f4
commit 9ca0e7ad9b
  1. 2
      src/bin/ephoto.h
  2. 2
      src/bin/ephoto_config.c
  3. 10
      src/bin/ephoto_directory_browser.c
  4. 2
      src/bin/ephoto_main.c

@ -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);

@ -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);

@ -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;

@ -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);

Loading…
Cancel
Save