From: Jihoon Kim Date: Fri, 12 Sep 2014 05:41:34 +0000 (+0900) Subject: Fix performance issue when isf_control_get_ise_list () is called X-Git-Tag: submit/tizen/20150128.083920~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af201211676db10d68688e26353380ea226ae4a0;p=platform%2Fcore%2Fuifw%2Fisf.git Fix performance issue when isf_control_get_ise_list () is called [model] Kiran, B3 [binary_type] PDA [customer] OPEN [issue#] P140908-01708 [problem] launching delay in the text input setting [cause] isf_control_get_ise_list () takes about 150 ms [solution] No update ise list every time, use cache memory [team] Input Framework [request] N/A [horizontal_expansion] N/A Change-Id: Ie24ff8603ff665b5762a2d040b5476a9836be802 --- diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index cf0a2cde..294dfba7 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -3727,6 +3727,40 @@ static Eina_Bool ise_hide_timeout (void *data) return ECORE_CALLBACK_CANCEL; } +static bool update_ise_list (std::vector &list) +{ + /* update ise list */ + bool ret = isf_update_ise_list (ALL_ISE, _config); + + list.clear (); + list = _uuids; + + _panel_agent->update_ise_list (list); + + if (ret && _initial_ise_uuid.length () > 0) { + String active_uuid = _initial_ise_uuid; + String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String ("")); + if (std::find (_uuids.begin (), _uuids.end (), default_uuid) == _uuids.end ()) { + if ((_panel_agent->get_current_toolbar_mode () == TOOLBAR_KEYBOARD_MODE) && (_modes[get_ise_index (_initial_ise_uuid)] != TOOLBAR_KEYBOARD_MODE)) { + active_uuid = String (SCIM_COMPOSE_KEY_FACTORY_UUID); + } + set_active_ise (active_uuid, _soft_keyboard_launched); + } else if (_panel_agent->get_current_toolbar_mode () == TOOLBAR_HELPER_MODE) { // Check whether keyboard engine is installed + String IMENGINE_KEY = String (SCIM_CONFIG_DEFAULT_IMENGINE_FACTORY) + String ("/") + String ("~other"); + String keyboard_uuid = _config->read (IMENGINE_KEY, String ("")); + if (std::find (_uuids.begin (), _uuids.end (), keyboard_uuid) == _uuids.end ()) { + active_uuid = String (SCIM_COMPOSE_KEY_FACTORY_UUID); + _panel_agent->change_factory (active_uuid); + _config->write (IMENGINE_KEY, active_uuid); + _config->flush (); + } + } + } + + add_ise_directory_em (); + return ret; +} + /** * @brief Reload config slot function for PanelAgent. */ @@ -4782,36 +4816,14 @@ static bool slot_get_ise_list (std::vector &list) { SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n"; - /* update ise list */ - bool ret = isf_update_ise_list (ALL_ISE, _config); - - list.clear (); - list = _uuids; - - _panel_agent->update_ise_list (list); - - if (ret && _initial_ise_uuid.length () > 0) { - String active_uuid = _initial_ise_uuid; - String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String ("")); - if (std::find (_uuids.begin (), _uuids.end (), default_uuid) == _uuids.end ()) { - if ((_panel_agent->get_current_toolbar_mode () == TOOLBAR_KEYBOARD_MODE) && (_modes[get_ise_index (_initial_ise_uuid)] != TOOLBAR_KEYBOARD_MODE)) { - active_uuid = String (SCIM_COMPOSE_KEY_FACTORY_UUID); - } - set_active_ise (active_uuid, _soft_keyboard_launched); - } else if (_panel_agent->get_current_toolbar_mode () == TOOLBAR_HELPER_MODE) { // Check whether keyboard engine is installed - String IMENGINE_KEY = String (SCIM_CONFIG_DEFAULT_IMENGINE_FACTORY) + String ("/") + String ("~other"); - String keyboard_uuid = _config->read (IMENGINE_KEY, String ("")); - if (std::find (_uuids.begin (), _uuids.end (), keyboard_uuid) == _uuids.end ()) { - active_uuid = String (SCIM_COMPOSE_KEY_FACTORY_UUID); - _panel_agent->change_factory (active_uuid); - _config->write (IMENGINE_KEY, active_uuid); - _config->flush (); - } - } + if (_uuids.size () > 0) { + list = _uuids; + } + else { + return update_ise_list (list); } - add_ise_directory_em (); - return ret; + return true; } /** @@ -6400,7 +6412,7 @@ int main (int argc, char *argv []) try { /* Update ISE list */ std::vector list; - slot_get_ise_list (list); + update_ise_list (list); /* Load initial ISE information */ _initial_ise_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (SCIM_COMPOSE_KEY_FACTORY_UUID));