change to get font type API with reading vconf directly. 77/155877/2 accepted/tizen/unified/20171017.204737 submit/tizen/20171017.050207
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 10:56:41 +0000 (19:56 +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 de0f702..5afa29c 100644 (file)
@@ -80,7 +80,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();
@@ -188,7 +188,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;
@@ -201,9 +201,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;
 }
 
@@ -666,7 +670,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;
@@ -679,13 +683,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;
index 8f59288..d942157 100644 (file)
@@ -397,7 +397,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);