From e868e8484408803fe7c0f5e7dc74c40d2287fa19 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 23 Aug 2019 18:50:59 +0900 Subject: [PATCH] Replace code to get display language Change-Id: I5f6907f6539d0c27549332ef2b9178af42149383 Signed-off-by: Jihoon Kim --- CMakeLists.txt | 2 ++ packaging/ise-default.spec | 1 + src/include/ise-stt-common.h | 1 + src/ise-stt-common.cpp | 6 +++--- src/ise-stt-option.cpp | 9 +++++---- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c06afc..0d3dae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ SET(PKGS_CHECK_MODULES capi-appfw-preference capi-media-audio-io capi-ui-inputmethod + capi-system-system-settings smartreply key-manager ode @@ -100,6 +101,7 @@ SET(SETTING_PKGS_CHECK_MODULES libxml-2.0 capi-appfw-application capi-appfw-preference + capi-system-system-settings key-manager ) diff --git a/packaging/ise-default.spec b/packaging/ise-default.spec index f937c1f..9ab9cd6 100644 --- a/packaging/ise-default.spec +++ b/packaging/ise-default.spec @@ -24,6 +24,7 @@ BuildRequires: pkgconfig(capi-ui-inputmethod) BuildRequires: pkgconfig(smartreply) BuildRequires: pkgconfig(key-manager) BuildRequires: pkgconfig(ode) +BuildRequires: pkgconfig(capi-system-system-settings) Requires: ise-engine-tables Requires: ise-engine-tables-zh Requires: ise-engine-hangul diff --git a/src/include/ise-stt-common.h b/src/include/ise-stt-common.h index 91403d6..ba6e6c2 100644 --- a/src/include/ise-stt-common.h +++ b/src/include/ise-stt-common.h @@ -24,6 +24,7 @@ #include +#include #include "ise-stt-mode.h" #ifdef EAPI diff --git a/src/ise-stt-common.cpp b/src/ise-stt-common.cpp index c456d6b..ba56d11 100644 --- a/src/ise-stt-common.cpp +++ b/src/ise-stt-common.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include #include @@ -67,8 +67,8 @@ void get_stt_default_language(VoiceData *my_voicedata) // get system display language char* value = NULL; - value = vconf_get_str(VCONFKEY_LANGSET); - if (NULL == value) { + int ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &value); + if (ret != SYSTEM_SETTINGS_ERROR_NONE) { LOGW("Fail to get display language"); return; } diff --git a/src/ise-stt-option.cpp b/src/ise-stt-option.cpp index c8f24b1..eee168c 100644 --- a/src/ise-stt-option.cpp +++ b/src/ise-stt-option.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include #include @@ -185,9 +185,9 @@ static char *__get_genlist_item_label(void *data, Evas_Object *obj, const char * } else if (!strcmp(part, "elm.text.1")) { if ((long)data == 0) { char* value = NULL; - value = vconf_get_str(VCONFKEY_LANGSET); - if (NULL == value) { - LOGD("Fail to get display language"); + int ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &value); + if (ret != SYSTEM_SETTINGS_ERROR_NONE) { + LOGW("Fail to get display language"); return NULL; } LOGD("system language (%s)", value); @@ -195,6 +195,7 @@ static char *__get_genlist_item_label(void *data, Evas_Object *obj, const char * char system_lang[6] = {0, }; strncpy(system_lang, value , 5); free(value); + value = NULL; // confirm whether the system language is supported by stt engine or not. // if supported, set the language -- 2.7.4