mirror of https://github.com/MidnightCommander/mc
Renamed mc_config_direct_set_string() to mc_config_set_string_raw()
... and avoid any string modification before save to ini. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
bbb6233049
commit
1ae9172d2a
|
@ -64,7 +64,7 @@ int *mc_config_get_int_list (mc_config_t *, const gchar *, const gchar *, gsize
|
|||
|
||||
/* mcconfig/set.c: */
|
||||
|
||||
void mc_config_direct_set_string (mc_config_t *, const gchar *, const gchar *, const gchar *);
|
||||
void mc_config_set_string_raw (mc_config_t *, const gchar *, const gchar *, const gchar *);
|
||||
|
||||
void mc_config_set_string (mc_config_t *, const gchar *, const gchar *, const gchar *);
|
||||
|
||||
|
|
|
@ -66,19 +66,15 @@ mc_config_normalize_before_save (const gchar * value)
|
|||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
void
|
||||
mc_config_direct_set_string (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * value)
|
||||
mc_config_set_string_raw (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, const gchar * value)
|
||||
{
|
||||
gchar *buffer;
|
||||
|
||||
if (!mc_config || !group || !param || !value)
|
||||
return;
|
||||
|
||||
buffer = mc_config_normalize_before_save (value);
|
||||
|
||||
g_key_file_set_value (mc_config->handle, group, param, buffer);
|
||||
|
||||
g_free (buffer);
|
||||
g_key_file_set_value (mc_config->handle, group, param, value);
|
||||
}
|
||||
|
||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
|
|
@ -367,8 +367,8 @@ learn_save (void)
|
|||
|
||||
esc_str = strutils_escape (learnkeys[i].sequence, -1, ";\\", TRUE);
|
||||
|
||||
mc_config_direct_set_string (mc_main_config, section,
|
||||
key_name_conv_tab[i].name, esc_str);
|
||||
mc_config_set_string_raw (mc_main_config, section,
|
||||
key_name_conv_tab[i].name, esc_str);
|
||||
|
||||
g_free (esc_str);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue