Fix performance issue when isf_control_get_ise_list () is called 96/33596/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 12 Sep 2014 05:41:34 +0000 (14:41 +0900)
committerLi Zhang <li2012.zhang@samsung.com>
Tue, 13 Jan 2015 08:35:44 +0000 (16:35 +0800)
[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

ism/extras/efl_panel/isf_panel_efl.cpp

index cf0a2cde6456cf2cecc6dfc528189e69bc47b900..294dfba7e7d7946ae34cae199c31b3337ea62b52 100644 (file)
@@ -3727,6 +3727,40 @@ static Eina_Bool ise_hide_timeout (void *data)
     return ECORE_CALLBACK_CANCEL;
 }
 
+static bool update_ise_list (std::vector<String> &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<String> &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<String> 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));