#include <livebox-errno.h>
#include <provider.h>
+#include <system_settings.h>
+
#include <packet.h>
#include <com-core.h>
#include <com-core_packet.h>
{
char *font_name;
- font_name = vconf_get_str("db/setting/accessibility/font_name");
- if (!font_name) {
- ErrPrint("Invalid font name (NULL)\n");
- return;
- }
+ if (s_info.font_name) {
+ font_name = vconf_get_str("db/setting/accessibility/font_name");
+ if (!font_name) {
+ ErrPrint("Invalid font name (NULL)\n");
+ return;
+ }
- if (s_info.font_name && !strcmp(s_info.font_name, font_name)) {
- DbgPrint("Font is not changed (Old: %s(%p) <> New: %s(%p))\n", s_info.font_name, s_info.font_name, font_name, font_name);
- free(font_name);
- return;
- }
+ if (!strcmp(s_info.font_name, font_name)) {
+ DbgPrint("Font is not changed (Old: %s(%p) <> New: %s(%p))\n", s_info.font_name, s_info.font_name, font_name, font_name);
+ free(font_name);
+ return;
+ }
- if (s_info.font_name) {
DbgPrint("Release old font name: %s(%p)\n", s_info.font_name, s_info.font_name);
free(s_info.font_name);
- s_info.font_name = NULL;
+ } else {
+ int ret;
+
+ font_name = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &font_name);
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE || !font_name) {
+ ErrPrint("system settings: %d, font_name[%p]\n", ret, font_name);
+ return;
+ }
}
s_info.font_name = font_name;
client_fini();
free(s_info.font_name);
+ s_info.font_name = NULL;
return;
}
{
char *font_name;
- font_name = vconf_get_str("db/setting/accessibility/font_name");
- if (!font_name) {
- ErrPrint("Invalid font name (NULL)\n");
- return;
- }
+ if (s_info.font_name) {
+ font_name = vconf_get_str("db/setting/accessibility/font_name");
+ if (!font_name) {
+ ErrPrint("Invalid font name (NULL)\n");
+ return;
+ }
- if (s_info.font_name && !strcmp(s_info.font_name, font_name)) {
- DbgPrint("Font is not changed (Old: %s(%p) <> New: %s(%p))\n", s_info.font_name, s_info.font_name, font_name, font_name);
- free(font_name);
- return;
- }
+ if (!strcmp(s_info.font_name, font_name)) {
+ DbgPrint("Font is not changed (Old: %s(%p) <> New: %s(%p))\n", s_info.font_name, s_info.font_name, font_name, font_name);
+ free(font_name);
+ return;
+ }
- if (s_info.font_name) {
DbgPrint("Release old font name: %s(%p)\n", s_info.font_name, s_info.font_name);
free(s_info.font_name);
- s_info.font_name = NULL;
+ } else {
+ int ret;
+
+ font_name = NULL;
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &font_name);
+ if (ret != SYSTEM_SETTINGS_ERROR_NONE || !font_name) {
+ ErrPrint("System settings: %d, font_name[%p]\n", ret, font_name);
+ return;
+ }
}
s_info.font_name = font_name;
static bool app_create(void *data)
{
int ret;
- int size = DEFAULT_FONT_SIZE;
DbgPrint("Scale factor: %lf\n", elm_config_scale_get());
ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb, NULL);
DbgPrint("MMC status changed event callback added: %d\n", ret);
- s_info.font_name = vconf_get_str("db/setting/accessibility/font_name");
- DbgPrint("Current font is [%s]\n", s_info.font_name);
-
- ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &size);
- DbgPrint("Current font size get: %d\n", ret);
-
- s_info.font_size = convert_font_size(size);
- DbgPrint("Current font size: %d\n", s_info.font_size);
-
+ font_changed_cb(NULL, NULL);
+ font_size_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE, NULL);
return TRUE;
}
ret = livebox_service_fini();
DbgPrint("livebox service fini: %d\n", ret);
+ free(s_info.font_name);
+ s_info.font_name = NULL;
return;
}