some less valgrind errors.

I guess I've spotted the main problem with eio usage, will commit in
another revision.



SVN revision: 53335
This commit is contained in:
Gustavo Sverzut Barbieri 2010-10-13 03:24:22 +00:00
parent f5e062c676
commit feba790912
3 changed files with 27 additions and 8 deletions

View File

@ -824,7 +824,12 @@ ephoto_flow_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
DBG("entry %p, was %p", entry, fb->entry);
fb->entry = entry;
if (!eina_stringshare_replace(&fb->path, entry->path))
if (!entry)
{
eina_stringshare_replace(&fb->path, NULL);
_ephoto_flow_browser_toolbar_eval(fb);
}
else if (!eina_stringshare_replace(&fb->path, entry->path))
_ephoto_flow_browser_toolbar_eval(fb);
else
{

View File

@ -78,6 +78,14 @@ _ephoto_thumb_browser_view(void *data, Evas_Object *obj __UNUSED__, void *event_
_ephoto_flow_browser_show(ephoto, entry);
}
static void
_ephoto_thumb_browser_changed_directory(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Ephoto *ephoto = data;
ephoto_flow_browser_entry_set(ephoto->flow_browser, NULL);
ephoto_slideshow_entry_set(ephoto->slideshow, NULL);
}
static void
_ephoto_thumb_browser_slideshow(void *data, Evas_Object *obj __UNUSED__, void *event_info)
{
@ -119,6 +127,7 @@ ephoto_window_add(const char *path)
{
Ephoto *ephoto = calloc(1, sizeof(Ephoto));
Ethumb_Client *client = elm_thumb_ethumb_client_get();
char buf[PATH_MAX];
EINA_SAFETY_ON_NULL_RETURN_VAL(ephoto, NULL);
ephoto->win = elm_win_add(NULL, "ephoto", ELM_WIN_BASIC);
@ -174,6 +183,9 @@ ephoto_window_add(const char *path)
elm_pager_content_push(ephoto->pager, ephoto->thumb_browser);
evas_object_smart_callback_add
(ephoto->thumb_browser, "view", _ephoto_thumb_browser_view, ephoto);
evas_object_smart_callback_add
(ephoto->thumb_browser, "changed,directory",
_ephoto_thumb_browser_changed_directory, ephoto);
evas_object_smart_callback_add
(ephoto->thumb_browser, "slideshow",
_ephoto_thumb_browser_slideshow, ephoto);
@ -205,7 +217,6 @@ ephoto_window_add(const char *path)
if ((!path) || (!ecore_file_exists(path)))
{
char buf[PATH_MAX];
path = ephoto->config->directory;
if ((path) && (!ecore_file_exists(path))) path = NULL;
if (!path)

View File

@ -259,10 +259,12 @@ _ephoto_populate_error(int error, void *data)
static void
_ephoto_populate_entries(Ephoto_Thumb_Browser *tb)
{
Edje_External_Param param;
/* Edje_External_Param param; */
char *parent_dir;
DBG("populate from '%s'", tb->ephoto->config->directory);
evas_object_smart_callback_call(tb->layout, "changed,directory", NULL);
elm_gengrid_clear(tb->grid);
ephoto_entries_free(tb->ephoto);
@ -279,11 +281,12 @@ _ephoto_populate_entries(Ephoto_Thumb_Browser *tb)
/* does not go into entries as it is always the first - no sort! */
}
param.name = "text";
param.type = EDJE_EXTERNAL_PARAM_TYPE_STRING;
param.s = tb->ephoto->config->directory;
edje_object_part_external_param_set(tb->edje, "ephoto.location", &param);
edje_object_signal_emit(tb->edje, "location,set", "ephoto");
/* TODO elm_fileselector_entry_path_set() */
/* param.name = "text"; */
/* param.type = EDJE_EXTERNAL_PARAM_TYPE_STRING; */
/* param.s = tb->ephoto->config->directory; */
/* edje_object_part_external_param_set(tb->edje, "ephoto.location", &param); */
/* edje_object_signal_emit(tb->edje, "location,set", "ephoto"); */
edje_object_signal_emit(tb->edje, "populate,start", "ephoto");
tb->ls = eio_file_direct_ls(tb->ephoto->config->directory,