Wait for caches to update, then quit.

SVN revision: 56857
This commit is contained in:
Sebastian Dransfeld 2011-02-09 17:10:12 +00:00
parent bd1b8e9985
commit 01a9d81096
1 changed files with 28 additions and 0 deletions

View File

@ -10,6 +10,27 @@ EAPI Eina_List *efreet_util_desktop_generic_name_glob_list(const char *glob);
EAPI Eina_List *efreet_util_desktop_comment_glob_list(const char *glob);
#endif
static Eina_Bool icon_cb = EINA_FALSE;
static Eina_Bool desktop_cb = EINA_FALSE;
static Eina_Bool
icon_handler_cb(void *data __UNUSED__, int event_type __UNUSED__, void *event __UNUSED__)
{
icon_cb = EINA_TRUE;
if (icon_cb && desktop_cb)
ecore_main_loop_quit();
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
desktop_handler_cb(void *data __UNUSED__, int event_type __UNUSED__, void *event __UNUSED__)
{
desktop_cb = EINA_TRUE;
if (icon_cb && desktop_cb)
ecore_main_loop_quit();
return ECORE_CALLBACK_PASS_ON;
}
static void
check(void)
{
@ -135,9 +156,16 @@ check(void)
int
main(int argc __UNUSED__, char **argv __UNUSED__)
{
Ecore_Event_Handler *icon_handler;
Ecore_Event_Handler *desktop_handler;
if (!efreet_init()) return 1;
icon_handler = ecore_event_handler_add(EFREET_EVENT_ICON_CACHE_UPDATE, icon_handler_cb, NULL);
desktop_handler = ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, desktop_handler_cb, NULL);
check();
ecore_main_loop_begin();
ecore_event_handler_del(icon_handler);
ecore_event_handler_del(desktop_handler);
efreet_shutdown();
return 0;
}