X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=common%2Ftts_config_mgr.c;h=1522950376d9ff5fce2c289e2c3d8d2d6079b4e4;hb=f09e5290b213b4bb7f6f2bdf49188008e363aec6;hp=da566c70a7ced8a4a8a5f2eb80b8b54beea3b705;hpb=d51a567825da27f9b904bf00b6220394406e39cd;p=platform%2Fcore%2Fuifw%2Ftts.git diff --git a/common/tts_config_mgr.c b/common/tts_config_mgr.c index da566c7..1522950 100644 --- a/common/tts_config_mgr.c +++ b/common/tts_config_mgr.c @@ -330,7 +330,7 @@ int __tts_config_mgr_select_lang(const char* engine_id, char** language, int* ty Eina_Bool tts_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *fd_handler) { - SLOG(LOG_DEBUG, tts_tag(), "===== Config changed callback event"); + SLOG(LOG_DEBUG, tts_tag(), "@@@ Config changed callback event"); int length; struct inotify_event event; @@ -339,8 +339,7 @@ Eina_Bool tts_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *fd_handl length = read(g_config_fd_noti, &event, sizeof(struct inotify_event)); if (0 > length) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Empty Inotify event"); - SLOG(LOG_DEBUG, tts_tag(), "====="); - SLOG(LOG_DEBUG, tts_tag(), " "); + SLOG(LOG_DEBUG, tts_tag(), "@@@"); return ECORE_CALLBACK_DONE; } @@ -496,12 +495,17 @@ Eina_Bool tts_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *fd_handl free(lang); lang = NULL; } + } else if (IN_DELETE_SELF == event.mask) { + SLOG(LOG_ERROR, tts_tag(), "[ERROR] IN_DELETE_SELF event"); + + tts_parser_unload_config(g_config_info); + tts_parser_reset(); + tts_parser_load_config(&g_config_info); } else { - SLOG(LOG_ERROR, tts_tag(), "[ERROR] Undefined event"); + SLOG(LOG_ERROR, tts_tag(), "[ERROR] Undefined event (0x%x)", event.mask); } - SLOG(LOG_DEBUG, tts_tag(), "====="); - SLOG(LOG_DEBUG, tts_tag(), " "); + SLOG(LOG_DEBUG, tts_tag(), "@@@"); return ECORE_CALLBACK_PASS_ON; } @@ -519,7 +523,7 @@ int __tts_config_mgr_register_config_event() } g_config_fd_noti = fd; - wd = inotify_add_watch(fd, TTS_CONFIG, IN_CLOSE_WRITE); + wd = inotify_add_watch(fd, TTS_CONFIG, IN_CLOSE_WRITE|IN_DELETE_SELF); g_config_wd_noti = wd; g_config_fd_handler_noti = ecore_main_fd_handler_add(fd, ECORE_FD_READ, @@ -860,7 +864,7 @@ int __tts_config_mgr_get_engine_info() static Eina_Bool __tts_config_mgr_engine_config_inotify_event_callback(void* data, Ecore_Fd_Handler *fd_handler) { - SLOG(LOG_DEBUG, tts_tag(), "===== Engine config updated callback event"); + SLOG(LOG_DEBUG, tts_tag(), "@@@ Engine config updated callback event"); tts_engine_inotify_s *ino = (tts_engine_inotify_s *)data; int dir_fd = ino->dir_fd; @@ -872,8 +876,7 @@ static Eina_Bool __tts_config_mgr_engine_config_inotify_event_callback(void* dat length = read(dir_fd, &event, sizeof(struct inotify_event)); if (0 > length) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Empty Inotify event"); - SLOG(LOG_DEBUG, tts_tag(), "====="); - SLOG(LOG_DEBUG, tts_tag(), " "); + SLOG(LOG_DEBUG, tts_tag(), "@@@"); return ECORE_CALLBACK_DONE; } @@ -928,8 +931,7 @@ static Eina_Bool __tts_config_mgr_engine_config_inotify_event_callback(void* dat SLOG(LOG_ERROR, tts_tag(), "[ERROR] Undefined event"); } - SLOG(LOG_DEBUG, tts_tag(), "====="); - SLOG(LOG_DEBUG, tts_tag(), " "); + SLOG(LOG_DEBUG, tts_tag(), "@@@"); return ECORE_CALLBACK_PASS_ON; } @@ -1178,7 +1180,7 @@ int tts_config_mgr_initialize(int uid) } /* print daemon config */ - SLOG(LOG_DEBUG, tts_tag(), "== TTS config =="); + SLOG(LOG_DEBUG, tts_tag(), "@@@ TTS config @@@"); SECURE_SLOG(LOG_DEBUG, tts_tag(), " engine : %s", g_config_info->engine_id); SECURE_SLOG(LOG_DEBUG, tts_tag(), " setting : %s", g_config_info->setting); SECURE_SLOG(LOG_DEBUG, tts_tag(), " auto voice : %s", g_config_info->auto_voice ? "on" : "off"); @@ -1186,7 +1188,7 @@ int tts_config_mgr_initialize(int uid) SECURE_SLOG(LOG_DEBUG, tts_tag(), " voice type : %d", g_config_info->type); SECURE_SLOG(LOG_DEBUG, tts_tag(), " speech rate : %d", g_config_info->speech_rate); SECURE_SLOG(LOG_DEBUG, tts_tag(), " pitch : %d", g_config_info->pitch); - SLOG(LOG_DEBUG, tts_tag(), "================="); + SLOG(LOG_DEBUG, tts_tag(), "@@@@@"); if (0 != __tts_config_mgr_register_config_event()) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to register config event");