From: Carsten Haitzler (Rasterman) Date: Tue, 25 Mar 2014 06:33:08 +0000 (+0900) Subject: fix config to upgrade bindings from system config if not there X-Git-Tag: v1.10.0+tech+preview~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0a9f992bc08065e41653be5a0cf1e274f16f1a6;p=platform%2Fupstream%2Felementary.git fix config to upgrade bindings from system config if not there --- diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index 28a5a80..6eed719 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -1774,6 +1774,50 @@ _config_update(void) } IFCFGEND; + IFCFG(0x0005); + COPYVAL(magnifier_scale); + if (!_elm_config->bindings) + { + Elm_Config_Bindings_Widget *wb; + Eina_List *l; + + EINA_LIST_FOREACH(tcfg->bindings, l, wb) + { + Elm_Config_Bindings_Widget *wb2; + + wb2 = calloc(1, sizeof(Elm_Config_Bindings_Widget)); + if (wb2) + { + Elm_Config_Binding_Key *kb; + Eina_List *l2; + + *wb2 = *wb; +#define DUPSHARE(x) if (wb->x) wb2->x = eina_stringshare_add(wb->x) + DUPSHARE(name); +#undef DUPSHARE + wb->key_bindings = NULL; + EINA_LIST_FOREACH(wb->key_bindings, l2, kb) + { + Elm_Config_Binding_Key *kb2; + + kb2 = calloc(1, sizeof(Elm_Config_Binding_Key)); + if (kb2) + { +#define DUPSHARE(x) if (kb->x) kb2->x = eina_stringshare_add(kb->x) + DUPSHARE(modifiers); + DUPSHARE(key); + DUPSHARE(action); + DUPSHARE(params); +#undef DUPSHARE + wb->key_bindings = eina_list_append(wb->key_bindings, kb2); + } + } + _elm_config->bindings = eina_list_append(_elm_config->bindings, wb2); + } + } + } + IFCFGEND; + #undef COPYSTR #undef COPYPTR #undef COPYVAL diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h index f977cbc..e83cd60 100644 --- a/src/lib/elm_priv.h +++ b/src/lib/elm_priv.h @@ -123,7 +123,7 @@ struct _Elm_Theme * the users config doesn't need to be wiped - simply new values need * to be put in */ -#define ELM_CONFIG_FILE_GENERATION 0x0004 +#define ELM_CONFIG_FILE_GENERATION 0x0005 #define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | \ ELM_CONFIG_FILE_GENERATION) /* NB: profile configuration files (.src) must have their