fix config to upgrade bindings from system config if not there

This commit is contained in:
Carsten Haitzler 2014-03-25 15:33:08 +09:00
parent fe621de2c1
commit 75d9be3b0a
2 changed files with 45 additions and 1 deletions

View File

@ -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

View File

@ -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