diff options
author | Inhong Han <inhong1.han@samsung.com> | 2018-12-12 11:12:28 +0900 |
---|---|---|
committer | Inhong Han <inhong1.han@samsung.com> | 2018-12-12 11:39:55 +0900 |
commit | 919a316d8293c863f7f69a4d53249730bc684e3d (patch) | |
tree | 69fa51b602511ece8a7b90f20b6b9520bab4dbdc | |
parent | 3fef71183ab1f9ad8d1f8716f69e94a69f1d3724 (diff) | |
download | isf-919a316d8293c863f7f69a4d53249730bc684e3d.tar.gz isf-919a316d8293c863f7f69a4d53249730bc684e3d.tar.bz2 isf-919a316d8293c863f7f69a4d53249730bc684e3d.zip |
Update language locale on LANGUAGE_EVENT only
The previous changeID I4a078d5bcce5ea231007c06ab52416606093701c
introduces a code segment that updates language locale
whenever the HelperAgent::update_input_context() gets called.
This is inefficient, thus added if() statement for checking
if the event type is actually LANGUAGE_EVENT
Change-Id: I2ead55babe56d0bc04151ccc422095e6fcc568a2
-rw-r--r-- | ism/src/scim_helper.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/ism/src/scim_helper.cpp b/ism/src/scim_helper.cpp index 2196e969..673ea9cb 100644 --- a/ism/src/scim_helper.cpp +++ b/ism/src/scim_helper.cpp @@ -49,6 +49,7 @@ #include <string.h> #include <unistd.h> #include <sys/time.h> +#include <Ecore_IMF.h> #include "scim_private.h" #include "scim.h" @@ -2026,21 +2027,23 @@ HelperAgent::update_associate_string (const LookupTable &table) const void HelperAgent::update_input_context (uint32 type, uint32 value) const { - /* Update all state variables that could be queried by the client application */ - char *buf = NULL; - m_impl->signal_get_language_locale(this, -1, &buf); - - if (buf != NULL) { - if (m_impl->socket_active.is_connected()) { - m_impl->send.clear(); - m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST); - m_impl->send.put_data(m_impl->magic_active); - m_impl->send.put_command(ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE); - m_impl->send.put_data(buf, strlen(buf)); - m_impl->send.write_to_socket(m_impl->socket_active, m_impl->magic_active); - } - free(buf); - buf = NULL; + if (type == ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT) { + /* Update all state variables that could be queried by the client application */ + char *buf = NULL; + m_impl->signal_get_language_locale(this, -1, &buf); + + if (buf != NULL) { + if (m_impl->socket_active.is_connected()) { + m_impl->send.clear(); + m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST); + m_impl->send.put_data(m_impl->magic_active); + m_impl->send.put_command(ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE); + m_impl->send.put_data(buf, strlen(buf)); + m_impl->send.write_to_socket(m_impl->socket_active, m_impl->magic_active); + } + free(buf); + buf = NULL; + } } if (m_impl->socket_active.is_connected ()) { |