Ticket #2676: mc-keybinding.patch

File mc-keybinding.patch, 1.8 KB (added by bircoph, 13 years ago)

fix keybindings save

  • lib/mcconfig.h

    diff --git a/lib/mcconfig.h b/lib/mcconfig.h
    index ff3abce..37246a3 100644
    a b int *mc_config_get_int_list (mc_config_t *, const gchar *, const gchar *, gsize 
    6868 
    6969void mc_config_set_string_raw (mc_config_t *, const gchar *, const gchar *, const gchar *); 
    7070 
     71void mc_config_set_string_raw_value (mc_config_t *, const gchar *, const gchar *, const gchar *); 
     72 
    7173void mc_config_set_string (const mc_config_t *, const gchar *, const gchar *, const gchar *); 
    7274 
    7375void mc_config_set_bool (mc_config_t *, const gchar *, const gchar *, gboolean); 
  • lib/mcconfig/set.c

    diff --git a/lib/mcconfig/set.c b/lib/mcconfig/set.c
    index 9678d28..6dc5397 100644
    a b mc_config_set_string_raw (mc_config_t * mc_config, const gchar * group, 
    7777    g_key_file_set_string (mc_config->handle, group, param, value); 
    7878} 
    7979 
     80void 
     81mc_config_set_string_raw_value (mc_config_t * mc_config, const gchar * group, 
     82                             const gchar * param, const gchar * value) 
     83{ 
     84    if (!mc_config || !group || !param || !value) 
     85        return; 
     86 
     87    g_key_file_set_value (mc_config->handle, group, param, value); 
     88} 
     89 
    8090/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 
    8191 
    8292void 
  • src/learn.c

    a b learn_save (void) 
    371371        { 
    372372            profile_changed = 1; 
    373373 
    374             esc_str = strutils_escape (learnkeys[i].sequence, -1, ";", TRUE); 
     374            esc_str = strutils_escape (learnkeys[i].sequence, -1, ";\\", TRUE); 
    375375 
    376             mc_config_set_string_raw (mc_main_config, section, key_name_conv_tab[i].name, esc_str); 
     376            mc_config_set_string_raw_value (mc_main_config, section, key_name_conv_tab[i].name, esc_str); 
    377377 
    378378            g_free (esc_str); 
    379379        }