summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-31 14:55:56 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-04 09:14:00 +0100
commit1587d7fa1bbac672139b870a252827b4f9ddc413 (patch)
tree5f1f0742e9a8d2b416f19e306620b974e301deee
parent12880f053c7a1d442be7b23612263fa10a418a1c (diff)
elm_config: add helper method for copying widget key bindings
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11262
-rw-r--r--src/lib/elementary/elm_config.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 5f754f9502..63eda20a3f 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -2297,6 +2297,23 @@ _elm_key_bindings_update(Elm_Config *cfg, Elm_Config *syscfg EINA_UNUSED)
2297} 2297}
2298 2298
2299static void 2299static void
2300_elm_key_bindings_copy_missing_bindings_of_widget(Elm_Config *cfg, Elm_Config *syscfg, const char *widget_name)
2301{
2302 Elm_Config_Bindings_Widget *wd;
2303 Eina_List *n, *nnext;
2304
2305 EINA_LIST_FOREACH_SAFE(syscfg->bindings, n, nnext, wd)
2306 {
2307 if (eina_streq(widget_name, wd->name))
2308 {
2309 syscfg->bindings = eina_list_remove_list(syscfg->bindings, n);
2310 cfg->bindings = eina_list_append(cfg->bindings, wd);
2311 printf("Upgraded keybindings for %s!\n", wd->name);
2312 }
2313 }
2314}
2315
2316static void
2300_elm_key_bindings_copy_missing_bindings(Elm_Config *cfg, Elm_Config *syscfg) 2317_elm_key_bindings_copy_missing_bindings(Elm_Config *cfg, Elm_Config *syscfg)
2301{ 2318{
2302 Eina_Hash *safed_bindings = eina_hash_string_superfast_new(NULL); 2319 Eina_Hash *safed_bindings = eina_hash_string_superfast_new(NULL);