summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2015-04-16 08:50:38 -0400
committerzmike <michael.blumenkrantz@gmail.com>2015-04-16 08:50:38 -0400
commit88a10f349733114c954860a627675e25780f6372 (patch)
treebf134464f2668710577a559b345839bdb1997873 /src
parent764297867cc67275175a3e5b868fcb77b7688e67 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/empc.c17
1 files 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
846 evas_object_data_set(win, "__empc_bg_paste", ev); 846 evas_object_data_set(win, "__empc_bg_paste", ev);
847 elm_gengrid_item_update(it); 847 elm_gengrid_item_update(it);
848 evas_object_data_del(win, "__empc_bg_paste"); 848 evas_object_data_del(win, "__empc_bg_paste");
849 elm_gengrid_item_update(it);
850 return EINA_TRUE; 849 return EINA_TRUE;
851 } 850 }
852 switch (ev->format) 851 switch (ev->format)
@@ -1519,6 +1518,16 @@ filesystem_item_image(void *data, Empc_Fetch_Request *req, Evas_Object *obj)
1519} 1518}
1520 1519
1521static void 1520static void
1521filesystem_item_content_get_post_save(void)
1522{
1523 Eina_List *l;
1524 Elm_Object_Item *it;
1525
1526 EINA_LIST_FOREACH(filesystems_realized, l, it)
1527 elm_gengrid_item_update(it);
1528}
1529
1530static void
1522filesystem_paste_download_start(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 1531filesystem_paste_download_start(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
1523{ 1532{
1524 evas_object_data_set(obj, "__empc_downloading", (void*)1); 1533 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
1602 memcpy(&album, p, pp - p); 1611 memcpy(&album, p, pp - p);
1603 album[pp - p] = 0; 1612 album[pp - p] = 0;
1604 if (img || uri) 1613 if (img || uri)
1605 save_image(EINA_TRUE, uri ? NULL : img, uri, artist, album, NULL); 1614 save_image(EINA_TRUE, uri ? NULL : img, uri, artist, album, uri ? filesystem_item_content_get_post_save : NULL);
1606 else 1615 else
1607 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, artist, album, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur); 1616 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, artist, album, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur);
1608 } 1617 }
1609 else 1618 else
1610 { 1619 {
1611 if (img || uri) 1620 if (img || uri)
1612 save_image(EINA_TRUE, uri ? NULL : img, uri, artist, p, NULL); 1621 save_image(EINA_TRUE, uri ? NULL : img, uri, artist, p, uri ? filesystem_item_content_get_post_save : NULL);
1613 else 1622 else
1614 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, artist, p, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur); 1623 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, artist, p, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur);
1615 } 1624 }
@@ -1617,7 +1626,7 @@ filesystem_item_content_get(Empc_Entity *ent, Evas_Object *obj, const char *part
1617 else 1626 else
1618 { 1627 {
1619 if (img || uri) 1628 if (img || uri)
1620 save_image(EINA_TRUE, uri ? NULL : img, uri, dir->uri, NULL, NULL); 1629 save_image(EINA_TRUE, uri ? NULL : img, uri, dir->uri, NULL, uri ? filesystem_item_content_get_post_save : NULL);
1621 else 1630 else
1622 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, dir->uri, NULL, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur); 1631 req = metadata_fetch_begin(EMPC_METADATA_TYPE_IMAGE, obj, dir->uri, NULL, dir->uri, EINA_FALSE, EINA_FALSE, filesystem_item_image, cur);
1623 } 1632 }