From f6979318dcf5a721b5aa61d747de75e072dea1a6 Mon Sep 17 00:00:00 2001 From: MyoungJune Park Date: Wed, 10 Apr 2013 17:40:28 +0900 Subject: [PATCH] bool, int - data type ckecking --- TC_gui/main.c | 11 ++++++++--- src/system_settings_vconf.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/TC_gui/main.c b/TC_gui/main.c index 60b4f58..6aafa91 100644 --- a/TC_gui/main.c +++ b/TC_gui/main.c @@ -132,13 +132,18 @@ void list_item_touch_handler4(void* data, Evas_Object* obj, void* event_info) void list_item_touch_handler5(void* data, Evas_Object* obj, void* event_info) { + printf(">>>>>>>> motion activation ON (SET) \n"); + system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, 1/*ON*/); + bool enableMotion = false;; - printf(">>>>>>>> motion activation (GET) \n"); int errorcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, &enableMotion); - + printf(">>>>>>>> motion activation (GET TEST 1) -- %d - errorcode : %d \n", enableMotion, errorcode); printf(">>>>>>>> motion activation ON (SET) \n"); - system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, 1/*ON*/); + system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, 0/*ON*/); + + errorcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, &enableMotion); + printf(">>>>>>>> motion activation (GET TEST 2) -- %d - errorcode : %d \n", enableMotion, errorcode); } void list_item_touch_handler6(void* data, Evas_Object* obj, void* event_info) diff --git a/src/system_settings_vconf.c b/src/system_settings_vconf.c index cea084e..f8a24ff 100644 --- a/src/system_settings_vconf.c +++ b/src/system_settings_vconf.c @@ -38,7 +38,17 @@ int system_setting_vconf_get_value_int(const char *vconf_key, int *value) int system_setting_vconf_get_value_bool(const char *vconf_key, bool *value) { - return vconf_get_bool(vconf_key, (int*)value); + int tempvalue = 0; + int ret = vconf_get_bool(vconf_key, &tempvalue); + + if (tempvalue == 1) + { + *value = true; + } + else { + *value = false; + } + return ret; } int system_setting_vconf_get_value_double(const char *vconf_key, double *value) -- 2.7.4