diff options
-rw-r--r-- | src/setting-mobile-networks.c | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/src/setting-mobile-networks.c b/src/setting-mobile-networks.c index 5500b46..adc3643 100644 --- a/src/setting-mobile-networks.c +++ b/src/setting-mobile-networks.c @@ -413,7 +413,7 @@ static void _set_data_roaming_cancel_cb(void *data, Evas_Object *obj, void *even elm_check_state_set(check, EINA_FALSE); int ret = vconf_set_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, false); - if (ret != SYSTEM_SETTINGS_ERROR_NONE) { + if (ret < 0) { ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); } @@ -431,7 +431,7 @@ static void _set_data_roaming_ok_clicked_cb(void *data, Evas_Object *obj, void * elm_check_state_set(check, EINA_TRUE); int ret = vconf_set_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, true); - if (ret != SYSTEM_SETTINGS_ERROR_NONE) { + if (ret < 0) { ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); } @@ -471,6 +471,11 @@ static void _data_roaming_check_cb(void *data, Evas *e, Evas_Object *obj, void * DBG("_data_roaming_check_cb is called!!!!!!!"); + int ret = vconf_get_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, &is_data_roaming); + if (ret < 0) { + ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); + } + DBG("is_data_roaming:%d ", is_data_roaming); if (!is_data_roaming) { @@ -528,7 +533,10 @@ static void _data_roaming_check_cb(void *data, Evas *e, Evas_Object *obj, void * } else { elm_check_state_set(check, EINA_FALSE); set_disable_mobile_networks(); - elm_genlist_realized_items_update(g_mobile_networks_genlist); + ret = vconf_set_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, false); + if (ret < 0) { + ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); + } } @@ -540,7 +548,7 @@ Evas_Object *_gl_mobile_networks_check_get(void *data, Evas_Object *obj, const c mobile_networks_Item_Data *id = data; int index = id->index; bool is_value = 0; - int val = 0; + int ret = 0; if (!strcmp(part, "elm.icon")) { check = elm_check_add(obj); @@ -553,7 +561,10 @@ Evas_Object *_gl_mobile_networks_check_get(void *data, Evas_Object *obj, const c break; case 1: g_data_roaming_check = check; - is_value = val ? true : false; + ret = vconf_get_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, &is_value); + if (ret < 0) { + ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); + } evas_object_event_callback_add(check, EVAS_CALLBACK_MOUSE_DOWN, _data_roaming_check_cb, (void *)check); break; default: @@ -722,6 +733,12 @@ void _data_roaming_cb(void *data, Evas_Object *obj, void *event_info) DBG("_data_roaming_check_cb is called!!!!!!!"); + int ret = vconf_get_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, &is_data_roaming); + if (ret < 0) { + ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); + } + + Evas_Object *check = g_data_roaming_check; DBG("is_data_roaming:%d ", is_data_roaming); @@ -782,7 +799,10 @@ void _data_roaming_cb(void *data, Evas_Object *obj, void *event_info) } else { elm_check_state_set(check, EINA_FALSE); set_disable_mobile_networks(); - elm_genlist_realized_items_update(g_mobile_networks_genlist); + ret = vconf_set_bool(VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL, false); + if (ret < 0) { + ERR("Setting VCONFKEY_SETAPPL_STATE_DATA_ROAMING_BOOL failed!"); + } } } @@ -1221,7 +1241,6 @@ static void _mobile_networks_mode_gl_cb(void *data, Evas_Object *obj, void *even g_network_mode = network_mode; } - elm_genlist_realized_items_update(g_mobile_networks_genlist); elm_naviframe_item_pop(g_app_context->nf); back_button_cb_pop(); @@ -1637,21 +1656,10 @@ static int set_disable_mobile_networks() ERR("stc_initialize() error: %s", get_error_message(ret)); return -1; } - char *subscriber_id; /* Subscriber ID numbers of sim cards*/ - ret = telephony_sim_get_state(tel_h_list.handle[0], &sim_state); - if (TELEPHONY_ERROR_NONE == ret && - TELEPHONY_SIM_STATE_AVAILABLE == sim_state) { - - multi_main_loop = g_main_loop_new(NULL, FALSE); - - g_main_loop_run(multi_main_loop); - - if (subscriber_id) { - free(subscriber_id); - subscriber_id = 0; - } + if (TELEPHONY_ERROR_NONE != ret) { + ERR("telephony_sim_get_state failed"); } stc_deinitialize(stc); |