change to get font type API with reading vconf directly. 75/155875/3 accepted/tizen_3.0_common accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable tizen_3.0 accepted/tizen/3.0/common/20171019.135702 accepted/tizen/3.0/mobile/20171019.104424 accepted/tizen/3.0/tv/20171019.104442 accepted/tizen/3.0/wearable/20171019.104501 submit/tizen_3.0/20171017.050021
authorjinwang.an <jinwang.an@samsung.com>
Mon, 16 Oct 2017 10:42:11 +0000 (19:42 +0900)
committerjinwang.an <jinwang.an@samsung.com>
Mon, 16 Oct 2017 11:08:31 +0000 (20:08 +0900)
Change-Id: I73ff9a9d104727629bae9d1797bea24bf3c7c19c
Signed-off-by: jinwang.an <jinwang.an@samsung.com>
src/system_setting_platform.c
system-settings-util/src/system_settings_util.c

index 54b091d..e3722c8 100644 (file)
@@ -78,7 +78,7 @@ int _is_file_accessible(const char *path);
 
 static bool dl_is_supported_image_type_load(char *path);
 static bool dl_font_config_set(char *font_name);
-static char *dl_get_font_info(char *str);
+static char *dl_get_default_font_info();
 static int dl_is_available_font(char *str);
 static void dl_font_size_set();
 static void dl_font_config_set_notification();
@@ -177,7 +177,7 @@ int system_setting_get_font_size(system_settings_key_e key, system_setting_data_
 int system_setting_get_default_font_type(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
 {
        SETTING_TRACE_BEGIN;
-       char *font_name = dl_get_font_info("default");
+       char *font_name = dl_get_default_font_info();
        if (font_name) {
                *value = (void *)font_name;
                return SYSTEM_SETTINGS_ERROR_NONE;
@@ -190,9 +190,13 @@ int system_setting_get_default_font_type(system_settings_key_e key, system_setti
 int system_setting_get_font_type(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
 {
        SETTING_TRACE_BEGIN;
-       char *font_name = dl_get_font_info("cur");
-       *value = (void *)font_name;
+       char *font_name = NULL;
+
+       if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, &font_name)) {
+               return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+       }
 
+       *value = font_name;
        return SYSTEM_SETTINGS_ERROR_NONE;
 }
 
@@ -655,7 +659,7 @@ static bool dl_font_config_set(char *font_name)
 /*  LCOV_EXCL_STOP */
 
 /*  LCOV_EXCL_START */
-static char *dl_get_font_info(char *str)
+static char *dl_get_default_font_info()
 {
        void *handle = NULL;
        char *error;
@@ -668,13 +672,10 @@ static char *dl_get_font_info(char *str)
                return false;
        }
 
-       if (strcmp(str, "cur") == 0)
-               get_font_info = dlsym(handle, "_get_cur_font");
-       else
-               get_font_info = dlsym(handle, "_get_default_font");
+       get_font_info = dlsym(handle, "_get_default_font");
 
        if ((error = dlerror()) != NULL) {
-               SETTING_TRACE("ERROR!! canNOT find %s function at libsystem-settings-util.so.0.1.0", str);
+               SETTING_TRACE("ERROR!! canNOT find _get_default_font function at libsystem-settings-util.so.0.1.0");
                if (handle)
                        dlclose(handle);
                return false;
@@ -801,7 +802,7 @@ static int system_setting_remove_oldest_extended_wallpaper()
                        continue;
 
                if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
-                   != SYSTEM_SETTINGS_ERROR_NONE) {
+                       != SYSTEM_SETTINGS_ERROR_NONE) {
                        return SYSTEM_SETTINGS_ERROR_IO_ERROR;
                }
 
@@ -883,7 +884,7 @@ int system_setting_set_wallpaper_home_screen(system_settings_key_e key, system_s
                                continue;
 
                        if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
-                           != SYSTEM_SETTINGS_ERROR_NONE) {
+                               != SYSTEM_SETTINGS_ERROR_NONE) {
                                if (dp)
                                        closedir(dp);
                                return SYSTEM_SETTINGS_ERROR_IO_ERROR;
@@ -908,14 +909,14 @@ int system_setting_set_wallpaper_home_screen(system_settings_key_e key, system_s
 
                /* Copy image to _TZ_SYS_DATA/setting/wallpaper/ */
                if (system_setting_copy_extended_wallpaper(file_name_buffer, vconf_value)
-                   != SYSTEM_SETTINGS_ERROR_NONE) {
+                       != SYSTEM_SETTINGS_ERROR_NONE) {
                        return SYSTEM_SETTINGS_ERROR_IO_ERROR;
                }
 
                /* remove oldest wallpaper */
                if (image_count >= WALLPAPER_MAX_COUNT) {
                        if (system_setting_remove_oldest_extended_wallpaper()
-                           != SYSTEM_SETTINGS_ERROR_NONE) {
+                               != SYSTEM_SETTINGS_ERROR_NONE) {
                                remove(file_name_buffer);
                                return SYSTEM_SETTINGS_ERROR_IO_ERROR;
                        }
index 7799e71..4737f9a 100644 (file)
@@ -394,7 +394,9 @@ void __font_size_set()
        SETTING_TRACE_BEGIN;
        char buf[255] = { 0 };
        int font_size = __font_size_get();
-       char *font_name = _get_cur_font();
+       char *font_name = NULL;
+
+       font_name = vconf_get_str(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME);
 
        snprintf(buf, sizeof(buf), "font_name: %s, font_size: %d", font_name, font_size);
        _efl_config_set(buf);