summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_menu.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-21 12:55:51 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-21 12:56:21 +0200
commita0ba7941ad6035db8a31dd3f85bd51368c1c233a (patch)
treed77c18a1c10afa18640698ca6e8962408abfe846 /src/lib/efreet/efreet_menu.c
parent51246fff6828e1d179c43b32895bb830b537f7d8 (diff)
efreet: Use end cb of thread to run cb
Diffstat (limited to '')
-rw-r--r--src/lib/efreet/efreet_menu.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c
index 9959f0366a..fa04616bd8 100644
--- a/src/lib/efreet/efreet_menu.c
+++ b/src/lib/efreet/efreet_menu.c
@@ -162,6 +162,7 @@ struct Efreet_Menu_Async
162 Efreet_Menu_Cb func; 162 Efreet_Menu_Cb func;
163 void *data; 163 void *data;
164 Eina_Stringshare *path; 164 Eina_Stringshare *path;
165 Efreet_Menu *menu;
165}; 166};
166 167
167static const char *efreet_menu_prefix = NULL; /**< The $XDG_MENU_PREFIX env var */ 168static const char *efreet_menu_prefix = NULL; /**< The $XDG_MENU_PREFIX env var */
@@ -318,6 +319,7 @@ static int efreet_menu_save_menu(Efreet_Menu *menu, FILE *f, int indent);
318static int efreet_menu_save_indent(FILE *f, int indent); 319static int efreet_menu_save_indent(FILE *f, int indent);
319 320
320static void _efreet_menu_async_parse_cb(void *data, Ecore_Thread *thread); 321static void _efreet_menu_async_parse_cb(void *data, Ecore_Thread *thread);
322static void _efreet_menu_async_end_cb(void *data, Ecore_Thread *thread);
321 323
322int 324int
323efreet_menu_init(void) 325efreet_menu_init(void)
@@ -542,7 +544,7 @@ efreet_menu_async_parse(const char *path, Efreet_Menu_Cb func, const void *data)
542 async->func = func; 544 async->func = func;
543 async->data = (void*)data; 545 async->data = (void*)data;
544 async->path = eina_stringshare_add(path); 546 async->path = eina_stringshare_add(path);
545 ecore_thread_run(_efreet_menu_async_parse_cb, NULL, NULL, async); 547 ecore_thread_run(_efreet_menu_async_parse_cb, _efreet_menu_async_end_cb, NULL, async);
546} 548}
547 549
548EAPI Efreet_Menu * 550EAPI Efreet_Menu *
@@ -3864,12 +3866,16 @@ static void
3864_efreet_menu_async_parse_cb(void *data, Ecore_Thread *thread EINA_UNUSED) 3866_efreet_menu_async_parse_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
3865{ 3867{
3866 Efreet_Menu_Async *async = data; 3868 Efreet_Menu_Async *async = data;
3867 Efreet_Menu *menu;
3868 3869
3869 menu = efreet_menu_parse(async->path); 3870 async->menu = efreet_menu_parse(async->path);
3870 ecore_thread_main_loop_begin(); 3871}
3871 async->func(async->data, menu); 3872
3872 ecore_thread_main_loop_end(); 3873static void
3874_efreet_menu_async_end_cb(void *data, Ecore_Thread *thread EINA_UNUSED)
3875{
3876 Efreet_Menu_Async *async = data;
3877
3878 async->func(async->data, async->menu);
3873 eina_stringshare_del(async->path); 3879 eina_stringshare_del(async->path);
3874 free(async); 3880 free(async);
3875} 3881}