Replace code to get display language 11/212611/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 23 Aug 2019 09:50:59 +0000 (18:50 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 23 Aug 2019 09:50:59 +0000 (18:50 +0900)
Change-Id: I5f6907f6539d0c27549332ef2b9178af42149383
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
CMakeLists.txt
packaging/ise-default.spec
src/include/ise-stt-common.h
src/ise-stt-common.cpp
src/ise-stt-option.cpp

index 2c06afc..0d3dae8 100644 (file)
@@ -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
         )
 
index f937c1f..9ab9cd6 100644 (file)
@@ -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
index 91403d6..ba6e6c2 100644 (file)
@@ -24,6 +24,7 @@
 
 
 #include <Elementary.h>
+#include <vconf.h>
 #include "ise-stt-mode.h"
 
 #ifdef EAPI
index c456d6b..ba56d11 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <vconf.h>
+#include <system_settings.h>
 #include <stdio.h>
 #include <Ecore.h>
 #include <dlog.h>
@@ -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;
                 }
index c8f24b1..eee168c 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <vconf.h>
+#include <system_settings.h>
 #include <stdio.h>
 #include <Ecore.h>
 #include <dlog.h>
@@ -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