From 6e63b962bd2581a1720778ac5f2437b8aa51e893 Mon Sep 17 00:00:00 2001 From: titan Date: Thu, 8 Jul 2010 18:53:18 +0000 Subject: [PATCH] Better use of the stringshare_replace function. Once again gracias k-s. SVN revision: 50130 --- src/bin/ephoto_thumb_browser.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 77aa012..426b8e2 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -403,24 +403,21 @@ _ephoto_directory_chosen(void *data, Evas_Object *obj, void *event_info) directory = elm_fileselector_selected_get(obj); - if (directory && directory != current_directory) + if ((directory) && (eina_stringshare_replace(¤t_directory, directory))) { - if (eina_stringshare_replace(¤t_directory, directory)) - { - l = elm_gengrid_items_get(em->thumb_browser); - EINA_LIST_FOREACH(l, iter, item) - { - etd = (Ephoto_Thumb_Data *)elm_gengrid_item_data_get(item); - eina_stringshare_del(etd->thumb_path); - eina_stringshare_del(etd->file); - free(etd); - } - elm_gengrid_clear(em->thumb_browser); - eina_list_free(em->images); - em->images = NULL; - ephoto_populate_thumbnails(); - elm_label_label_set(dir_label, current_directory); - } + l = elm_gengrid_items_get(em->thumb_browser); + EINA_LIST_FOREACH(l, iter, item) + { + etd = (Ephoto_Thumb_Data *)elm_gengrid_item_data_get(item); + eina_stringshare_del(etd->thumb_path); + eina_stringshare_del(etd->file); + free(etd); + } + elm_gengrid_clear(em->thumb_browser); + eina_list_free(em->images); + em->images = NULL; + ephoto_populate_thumbnails(); + elm_label_label_set(dir_label, current_directory); } evas_object_del(obj); evas_object_del(win);