summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-25 15:33:08 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-25 15:33:08 +0900
commitf0a9f992bc08065e41653be5a0cf1e274f16f1a6 (patch)
treefe8c464c0116e20a443dfcfbc144157fb9b33ae5
parentac180368becb112c249c19fd326ce43c5fbe0c56 (diff)
fix config to upgrade bindings from system config if not there
-rw-r--r--src/lib/elm_config.c44
-rw-r--r--src/lib/elm_priv.h2
2 files changed, 45 insertions, 1 deletions
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 28a5a8021..6eed719a3 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -1774,6 +1774,50 @@ _config_update(void)
1774 } 1774 }
1775 IFCFGEND; 1775 IFCFGEND;
1776 1776
1777 IFCFG(0x0005);
1778 COPYVAL(magnifier_scale);
1779 if (!_elm_config->bindings)
1780 {
1781 Elm_Config_Bindings_Widget *wb;
1782 Eina_List *l;
1783
1784 EINA_LIST_FOREACH(tcfg->bindings, l, wb)
1785 {
1786 Elm_Config_Bindings_Widget *wb2;
1787
1788 wb2 = calloc(1, sizeof(Elm_Config_Bindings_Widget));
1789 if (wb2)
1790 {
1791 Elm_Config_Binding_Key *kb;
1792 Eina_List *l2;
1793
1794 *wb2 = *wb;
1795#define DUPSHARE(x) if (wb->x) wb2->x = eina_stringshare_add(wb->x)
1796 DUPSHARE(name);
1797#undef DUPSHARE
1798 wb->key_bindings = NULL;
1799 EINA_LIST_FOREACH(wb->key_bindings, l2, kb)
1800 {
1801 Elm_Config_Binding_Key *kb2;
1802
1803 kb2 = calloc(1, sizeof(Elm_Config_Binding_Key));
1804 if (kb2)
1805 {
1806#define DUPSHARE(x) if (kb->x) kb2->x = eina_stringshare_add(kb->x)
1807 DUPSHARE(modifiers);
1808 DUPSHARE(key);
1809 DUPSHARE(action);
1810 DUPSHARE(params);
1811#undef DUPSHARE
1812 wb->key_bindings = eina_list_append(wb->key_bindings, kb2);
1813 }
1814 }
1815 _elm_config->bindings = eina_list_append(_elm_config->bindings, wb2);
1816 }
1817 }
1818 }
1819 IFCFGEND;
1820
1777#undef COPYSTR 1821#undef COPYSTR
1778#undef COPYPTR 1822#undef COPYPTR
1779#undef COPYVAL 1823#undef COPYVAL
diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h
index f977cbcfa..e83cd60b9 100644
--- a/src/lib/elm_priv.h
+++ b/src/lib/elm_priv.h
@@ -123,7 +123,7 @@ struct _Elm_Theme
123 * the users config doesn't need to be wiped - simply new values need 123 * the users config doesn't need to be wiped - simply new values need
124 * to be put in 124 * to be put in
125 */ 125 */
126#define ELM_CONFIG_FILE_GENERATION 0x0004 126#define ELM_CONFIG_FILE_GENERATION 0x0005
127#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | \ 127#define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | \
128 ELM_CONFIG_FILE_GENERATION) 128 ELM_CONFIG_FILE_GENERATION)
129/* NB: profile configuration files (.src) must have their 129/* NB: profile configuration files (.src) must have their