Files
main/x11/im/scim/files/scim-initial-locale-hotkey-20070922.patch
2015-07-28 10:10:58 +03:00

32 lines
1.7 KiB
Diff

--- scim-1.4.5/src/scim_hotkey.cpp.8-hotkey~ 2005-06-18 23:19:35.000000000 +1000
+++ scim-1.4.5/src/scim_hotkey.cpp 2007-04-17 10:15:41.000000000 +1000
@@ -362,11 +362,26 @@
if (config.null () || !config->valid ()) return;
KeyEventList keys;
+ String lang = scim_get_locale_language (scim_get_current_locale ());
+ String userconf = scim_get_user_data_dir () + String (SCIM_PATH_DELIM_STRING) + String ("config");
+ bool userconf_exist = true;
+
+ //If this is the first time to run scim on a machine.
+ if (access (userconf.c_str (), R_OK) !=0)
+ userconf_exist = false;
// Load the least important hotkeys first.
for (int i = SCIM_FRONTEND_HOTKEY_SHOW_FACTORY_MENU; i >= SCIM_FRONTEND_HOTKEY_TRIGGER; --i) {
- if (scim_string_to_key_list (keys, config->read (String (__scim_frontend_hotkey_config_paths [i]), String (__scim_frontend_hotkey_defaults [i]))))
- m_impl->m_matcher.add_hotkeys (keys, i);
+ if (userconf_exist == false ) {
+ String config_paths = String (__scim_frontend_hotkey_config_paths [i]) + "/" + lang;
+ if (scim_string_to_key_list (keys, config->read (config_paths, String (__scim_frontend_hotkey_defaults [i]))))
+ m_impl->m_matcher.add_hotkeys (keys, i);
+ config->write (String (__scim_frontend_hotkey_config_paths [i]),
+ config->read (config_paths, String (__scim_frontend_hotkey_defaults [i])));
+ } else {
+ if (scim_string_to_key_list (keys, config->read (String (__scim_frontend_hotkey_config_paths [i]), String (__scim_frontend_hotkey_defaults [i]))))
+ m_impl->m_matcher.add_hotkeys (keys, i);
+ }
}
}