discomfitor pushed a commit to branch master.

http://git.enlightenment.org/apps/empc.git/commit/?id=88a10f349733114c954860a627675e25780f6372

commit 88a10f349733114c954860a627675e25780f6372
Author: zmike <michael.blumenkra...@gmail.com>
Date:   Thu Apr 16 08:50:38 2015 -0400

    refresh current filesystem's realized items after completing a url paste
    
    should fix race condition when attempting to load the pasted/saved url
    out of the cache immediately after the paste
---
 src/bin/empc.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/bin/empc.c b/src/bin/empc.c
index 9fa6c5e..4dc34a2 100644
--- a/src/bin/empc.c
+++ b/src/bin/empc.c
@@ -846,7 +846,6 @@ bg_paste(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, Elm_Selection_Dat
         evas_object_data_set(win, "__empc_bg_paste", ev);
         elm_gengrid_item_update(it);
         evas_object_data_del(win, "__empc_bg_paste");
-        elm_gengrid_item_update(it);
         return EINA_TRUE;
      }
    switch (ev->format)
@@ -1519,6 +1518,16 @@ filesystem_item_image(void *data, Empc_Fetch_Request 
*req, Evas_Object *obj)
 }
 
 static void
+filesystem_item_content_get_post_save(void)
+{
+   Eina_List *l;
+   Elm_Object_Item *it;
+
+   EINA_LIST_FOREACH(filesystems_realized, l, it)
+     elm_gengrid_item_update(it);
+}
+
+static void
 filesystem_paste_download_start(void *data EINA_UNUSED, Evas_Object *obj, void 
*event_info EINA_UNUSED)
 {
    evas_object_data_set(obj, "__empc_downloading", (void*)1);
@@ -1602,14 +1611,14 @@ filesystem_item_content_get(Empc_Entity *ent, 
Evas_Object *obj, const char *part
                    memcpy(&album, p, pp - p);
                    album[pp - p] = 0;
                    if (img || uri)
-                     save_image(EINA_TRUE, uri ? NULL : img, uri, artist, 
album, NULL);
+                     save_image(EINA_TRUE, uri ? NULL : img, uri, artist, 
album, uri ? filesystem_item_content_get_post_save : NULL);
                    else
                      req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, 
artist, album, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur);
                 }
               else
                 {
                    if (img || uri)
-                     save_image(EINA_TRUE, uri ? NULL : img, uri, artist, p, 
NULL);
+                     save_image(EINA_TRUE, uri ? NULL : img, uri, artist, p, 
uri ? filesystem_item_content_get_post_save : NULL);
                    else
                      req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, 
artist, p, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur);
                 }
@@ -1617,7 +1626,7 @@ filesystem_item_content_get(Empc_Entity *ent, Evas_Object 
*obj, const char *part
          else
            {
               if (img || uri)
-                save_image(EINA_TRUE, uri ? NULL : img, uri, dir->uri, NULL, 
NULL);
+                save_image(EINA_TRUE, uri ? NULL : img, uri, dir->uri, NULL, 
uri ? filesystem_item_content_get_post_save : NULL);
               else
                 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, 
dir->uri, NULL, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur);
            }

-- 


Reply via email to