From 6d99accfe05dd2e8bfac8bf6cf33fcaeafb2f045 Mon Sep 17 00:00:00 2001 From: Andrew Savchenko Date: Mon, 5 Dec 2011 13:45:03 +0400 Subject: [PATCH] Ticket #2676 (save of some learned keys is broken) fixed saving of 'F13'-'F20' learned keys. Signed-off-by: Ilia Maslakov --- lib/mcconfig.h | 2 ++ lib/mcconfig/set.c | 12 ++++++++++++ src/learn.c | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/mcconfig.h b/lib/mcconfig.h index ff3abced2..874bb254d 100644 --- a/lib/mcconfig.h +++ b/lib/mcconfig.h @@ -68,6 +68,8 @@ int *mc_config_get_int_list (mc_config_t *, const gchar *, const gchar *, gsize void mc_config_set_string_raw (mc_config_t *, const gchar *, const gchar *, const gchar *); +void mc_config_set_string_raw_value (mc_config_t *, const gchar *, const gchar *, const gchar *); + void mc_config_set_string (const mc_config_t *, const gchar *, const gchar *, const gchar *); void mc_config_set_bool (mc_config_t *, const gchar *, const gchar *, gboolean); diff --git a/lib/mcconfig/set.c b/lib/mcconfig/set.c index 9678d28af..ee375f2d6 100644 --- a/lib/mcconfig/set.c +++ b/lib/mcconfig/set.c @@ -79,6 +79,18 @@ mc_config_set_string_raw (mc_config_t * mc_config, const gchar * group, /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ +void +mc_config_set_string_raw_value (mc_config_t * mc_config, const gchar * group, + const gchar * param, const gchar * value) +{ + if (!mc_config || !group || !param || !value) + return; + + g_key_file_set_value (mc_config->handle, group, param, value); +} + +/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + void mc_config_set_string (const mc_config_t * mc_config, const gchar * group, const gchar * param, const gchar * value) diff --git a/src/learn.c b/src/learn.c index 5e771c08a..39a8f1f6c 100644 --- a/src/learn.c +++ b/src/learn.c @@ -371,9 +371,9 @@ learn_save (void) { profile_changed = 1; - esc_str = strutils_escape (learnkeys[i].sequence, -1, ";", TRUE); + esc_str = strutils_escape (learnkeys[i].sequence, -1, ";\\", TRUE); - mc_config_set_string_raw (mc_main_config, section, key_name_conv_tab[i].name, esc_str); + mc_config_set_string_raw_value (mc_main_config, section, key_name_conv_tab[i].name, esc_str); g_free (esc_str); }