From 241d8f37a0d8705c223f738fc35bc3ce8c67de56 Mon Sep 17 00:00:00 2001 From: "sung1103.park" Date: Thu, 11 Jul 2013 18:09:53 +0900 Subject: [PATCH] sync with private --- modules/information/noti.c | 66 +++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/modules/information/noti.c b/modules/information/noti.c index 258ae1f..e4b868a 100755 --- a/modules/information/noti.c +++ b/modules/information/noti.c @@ -385,9 +385,10 @@ static void _indicator_noti_detailed_changed_cb(void *data, notification_type_e int i =0; int op_type = 0; - if(noti_ready==0) + notification_h noti_new = NULL; + for (i = 0; i < num_op; i++) { - for (i = 0; i < num_op; i++) + if(noti_ready==0) { notification_op_get_data(op_list + i, NOTIFICATION_OP_DATA_TYPE, &op_type); if(op_type ==NOTIFICATION_OP_SERVICE_READY) @@ -403,39 +404,65 @@ static void _indicator_noti_detailed_changed_cb(void *data, notification_type_e update_noti_module_new(data,type); } } - } - else - { - for (i = 0; i < num_op; i++) + else { notification_op_get_data(op_list + i, NOTIFICATION_OP_DATA_TYPE, &op_type); - } - - if(type!=-1) - { - switch(op_type) + notification_op_get_data(op_list + i, NOTIFICATION_OP_DATA_NOTI, ¬i_new); + if(type!=-1) { - case NOTIFICATION_OP_INSERT: - case NOTIFICATION_OP_UPDATE: - case NOTIFICATION_OP_DELETE: - update_noti_module_new(data,type); - break; - default: - break; + switch(op_type) + { + case NOTIFICATION_OP_INSERT: + case NOTIFICATION_OP_UPDATE: + case NOTIFICATION_OP_DELETE: + if(noti_new!=NULL) + { + char* pkgname = NULL; + notification_get_pkgname(noti_new, &pkgname); + } + update_noti_module_new(data,type); + break; + default: + break; + } } } + } } +static void indicator_noti_sim_slot_cb(keynode_t *node, void *data) +{ + int status = 0; + int ret; + + retif(data == NULL, , "Invalid parameter!"); + + ret = vconf_get_int(VCONFKEY_TELEPHONY_SIM_SLOT, &status); + if (ret == OK) + { + DBG("sim slot %d", status); + update_noti_module_new(data,NOTIFICATION_TYPE_NONE); + } + return; +} + static int register_noti_module(void *data) { retif(data == NULL, FAIL, "Invalid parameter!"); notification_error_e ret = NOTIFICATION_ERROR_NONE; + static int bRegisterd = 0; set_app_state(data); - notification_register_detailed_changed_cb(_indicator_noti_detailed_changed_cb, data); + if(bRegisterd==0) + { + notification_register_detailed_changed_cb(_indicator_noti_detailed_changed_cb, data); + bRegisterd = 1; + } + + vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, indicator_noti_sim_slot_cb, data); return OK; } @@ -452,6 +479,7 @@ static int unregister_noti_module(void) free_image_icon(data); status_list = eina_list_remove_list(status_list, l); } + vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT, indicator_noti_sim_slot_cb); eina_list_free(status_list); return OK; -- 2.7.4