bool, int - data type ckecking
authorMyoungJune Park <mj2004.park@samsung.com>
Wed, 10 Apr 2013 08:40:28 +0000 (17:40 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Wed, 10 Apr 2013 08:40:28 +0000 (17:40 +0900)
TC_gui/main.c
src/system_settings_vconf.c

index 60b4f58..6aafa91 100644 (file)
@@ -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)
index cea084e..f8a24ff 100644 (file)
@@ -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)