}
#endif
+static void restore_config ()
+{
+ if (!_config.null ()) {
+ String uuid = _initial_ise_uuid;
+
+ String global_uuid = scim_global_config_read (String(SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String(""));
+ if (global_uuid.length () > 0) uuid = global_uuid;
+
+ String default_uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String(""));
+ if (default_uuid.length() > 0) uuid = default_uuid;
+
+ if (global_uuid.length() == 0) {
+ scim_global_config_write (String(SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), uuid);
+ }
+ if (default_uuid.length() == 0) {
+ _config->write (SCIM_CONFIG_DEFAULT_HELPER_ISE, uuid);
+ }
+
+ scim_global_config_flush ();
+ _config->flush();
+
+ scim_global_config_reload ();
+ _config->reload ();
+ }
+}
+
/**
* @brief : Launches default soft keyboard for performance enhancement (It's not mandatory)
*/
{
SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
- String helper_uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String(""));
+ String helper_uuid;
+ if (!_config.null()) {
+ helper_uuid = _config->read(SCIM_CONFIG_DEFAULT_HELPER_ISE, String(""));
+ }
if (helper_uuid.length () > 0) {
/* Start default ISE */
change_keyboard_mode (TOOLBAR_HELPER_MODE);
} else {
set_temporary_ise (_initial_ise_uuid);
- if (!_config.null()) {
- scim_global_config_write(String(SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), _initial_ise_uuid);
- scim_global_config_flush();
-
- _config->flush();
- _config->reload();
- }
+ restore_config();
}
}
LOGW ("'%s' exists : %d, is_dir : %d", path,
(user_data_path_exists ? 1 : 0), (user_data_path_is_dir ? 1 : 0));
- /* Flush config before reloading */
- scim_global_config_flush ();
- scim_global_config_reload ();
+ scim_global_config_reload (true);
load_config ();
launch = false;
}
String default_ise_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), _initial_ise_uuid);
+
set_active_ise (default_ise_uuid, launch);
+ restore_config ();
+
g_monitor_user_data_path_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}