From: Bluezery <ohpowel@gmail.com>
authorBluezery <ohpowel@gmail.com>
Sun, 6 Nov 2011 06:11:57 +0000 (06:11 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Sun, 6 Nov 2011 06:11:57 +0000 (06:11 +0000)
Subject: [E-devel] [elm_map] ecore_file_download_full() should be used
properly

elm_map only checked that returned job is NULL.
But ecore_file_download_full() returns EINA_FALSE when error occurred.
So return value should be checked for proper usage.
Please review this simple bug fix

SVN revision: 64794

AUTHORS
src/bin/test_map.c
src/lib/elm_genlist.c
src/lib/elm_map.c

diff --git a/AUTHORS b/AUTHORS
index 3027c70..9be7cdf 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -49,3 +49,4 @@ Kim Yunhan <spbear@gmail.com>
 Bluezery <ohpowel@gmail.com>
 Nicolas Aguirre <aguirre.nicolas@gmail.com>
 Sanjeev BA <iamsanjeev@gmail.com>
+Bluezery <ohpowel@gmail.com>
index a341cf9..5b0d091 100644 (file)
@@ -711,7 +711,7 @@ _map_mouse_up(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj __U
 void
 test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   Evas_Object *win, *bg, *map;
+   Evas_Object *win, *bg, *map, *tab, *r, *en;
    int idx = 0;
 
    win = elm_win_add(NULL, "map", ELM_WIN_BASIC);
@@ -723,6 +723,19 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __
    elm_win_resize_object_add(win, bg);
    evas_object_show(bg);
 
+   tab = elm_table_add(win);
+   evas_object_size_hint_weight_set(tab, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, tab);
+   evas_object_show(tab);
+
+   r = evas_object_rectangle_add(evas_object_evas_get(win));
+   evas_object_color_set(r, 20, 40, 60, 255);
+   evas_object_size_hint_min_set(r, 200, 200);
+   evas_object_size_hint_weight_set(r, EVAS_HINT_EXPAND, 0);
+   evas_object_size_hint_fill_set(r, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_table_pack(tab, r, 0, 0, 1, 1);
+   evas_object_show(r);
+   
    map = elm_map_add(win);
    if (map)
      {
@@ -736,7 +749,9 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __
         printf("]\n");
 
         evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-        elm_win_resize_object_add(win, map);
+        evas_object_size_hint_fill_set(map, EVAS_HINT_FILL, EVAS_HINT_FILL);
+        elm_table_pack(tab, map, 0, 2, 1, 1);
+//        elm_win_resize_object_add(win, map);
         evas_object_data_set(map, "window", win);
 
         //
@@ -827,6 +842,14 @@ test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __
 
         evas_object_show(map);
      }
+   en = elm_entry_add(win);
+   elm_entry_scrollable_set(en, EINA_TRUE);
+   elm_entry_single_line_set(en, 1);
+   evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
+   evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.1);
+   elm_table_pack(tab, en, 0, 1, 1, 1);
+   evas_object_show(en);
+   
 
    evas_object_resize(win, 800, 800);
    evas_object_show(win);
index ff0d718..cd5282f 100644 (file)
@@ -3263,7 +3263,12 @@ _queue_process(Widget_Data *wd)
         it = wd->queue->data;
         wd->queue = eina_list_remove_list(wd->queue, wd->queue);
         it->item->queued = EINA_FALSE;
-        _item_block_add(wd, it);
+        if (!wd->blocks)
+          {
+             _item_block_add(wd, it);
+             _item_block_realize(it->item->block);
+          }
+        else _item_block_add(wd, it);
         t = ecore_time_get();
         if (it->item->block->changed)
           {
index 460298c..0af009f 100644 (file)
@@ -1284,9 +1284,9 @@ _process_download_list(Evas_Object *obj)
         if (gi->wd->download_num >= MAX_CONCURRENT_DOWNLOAD)
           break;
 
-        ecore_file_download_full(gi->source, gi->file, _tile_downloaded, NULL, gi, &(gi->job), wd->ua);
-        if (!gi->job)
-          DBG("Can't start to download %s to %s", gi->source, gi->file);
+        Eina_Bool ret = ecore_file_download_full(gi->source, gi->file, _tile_downloaded, NULL, gi, &(gi->job), wd->ua);
+        if (!ret || !gi->job)
+          WRN("Can't start to download %s to %s", gi->source, gi->file);
         else
           {
              gi->wd->download_num++;