From da303d73ac1834e612a2f20fadf1bcd192b4970d Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Thu, 10 Sep 2009 15:21:08 +0000 Subject: [PATCH] * removed edit/usermap.c edit/usermap.h Signed-off-by: Ilia Maslakov --- edit/Makefile.am | 2 +- edit/edit.c | 1 - edit/editoptions.c | 3 --- src/keybind.c | 10 +++++----- src/main.c | 9 ++++----- src/setup.c | 1 + 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/edit/Makefile.am b/edit/Makefile.am index 7eb9571ae..0b941a13c 100644 --- a/edit/Makefile.am +++ b/edit/Makefile.am @@ -9,7 +9,7 @@ endif libedit_a_SOURCES = \ bookmark.c edit.c editcmd.c editwidget.c editdraw.c editkeys.c \ editmenu.c editoptions.c editcmddef.h edit-impl.h edit.h edit-widget.h \ - editlock.c editlock.h syntax.c usermap.h usermap.c wordproc.c \ + editlock.c editlock.h syntax.c wordproc.c \ choosesyntax.c etags.c etags.h editcmd_dialogs.c editcmd_dialogs.h EXTRA_DIST = diff --git a/edit/edit.c b/edit/edit.c index 19b27a9a2..195e70d35 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -45,7 +45,6 @@ #include "editlock.h" #include "edit-widget.h" #include "../src/cmddef.h" -#include "usermap.h" #include "../src/tty/color.h" /* EDITOR_NORMAL_COLOR */ #include "../src/tty/tty.h" /* attrset() */ diff --git a/edit/editoptions.c b/edit/editoptions.c index 657cb9289..a3d62763f 100644 --- a/edit/editoptions.c +++ b/edit/editoptions.c @@ -34,7 +34,6 @@ #include "../src/global.h" #include "edit-impl.h" -#include "usermap.h" #include "../src/dialog.h" /* B_CANCEL */ #include "../src/wtools.h" /* QuickDialog */ @@ -177,6 +176,4 @@ edit_options_dialog (void) /* Load or unload syntax rules if the option has changed */ if (option_syntax_highlighting != old_syntax_hl) edit_load_syntax (wedit, NULL, option_syntax_type); - /* Load usermap if it's needed */ - edit_load_user_map (wedit); } diff --git a/src/keybind.c b/src/keybind.c index 8c42bfa82..e93a51cbc 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -295,7 +295,6 @@ keymap_add(GArray *keymap, int key, int cmd) { global_key_map_t new_one, *map; guint i; - map = &(g_array_index(keymap, global_key_map_t, 0)); for (i = 0; i < keymap->len; i++) { @@ -304,10 +303,11 @@ keymap_add(GArray *keymap, int key, int cmd) return; } } - - new_one.key = key; - new_one.command = cmd; - g_array_append_val(keymap, new_one); + if (key !=0 && cmd !=0) { + new_one.key = key; + new_one.command = cmd; + g_array_append_val(keymap, new_one); + } } diff --git a/src/main.c b/src/main.c index c7e88ec76..93c134817 100644 --- a/src/main.c +++ b/src/main.c @@ -1853,18 +1853,17 @@ do_nc (void) check_codeset(); main_map = default_main_map; - if (main_keymap && main_keymap->len > 0) - main_map = (global_key_map_t *) main_keymap->data; + if (main_keymap && main_keymap->len > 0) + main_map = (global_key_map_t *) main_keymap->data; main_x_map = default_main_x_map; - if (main_x_keymap && main_x_keymap->len > 0) - main_x_map = (global_key_map_t *) main_x_keymap->data; + if (main_x_keymap && main_x_keymap->len > 0) + main_x_map = (global_key_map_t *) main_x_keymap->data; panel_map = default_panel_keymap; if (panel_keymap && panel_keymap->len > 0) { - mc_log ("panel_keymap && panel_keymap->len > 0\n"); panel_map = (global_key_map_t *) panel_keymap->data; } diff --git a/src/setup.c b/src/setup.c index e66fbfd44..0bffcd240 100644 --- a/src/setup.c +++ b/src/setup.c @@ -857,6 +857,7 @@ load_keymap_defs (void) panel_keymap = g_array_new(TRUE, FALSE, sizeof(global_key_map_t)); load_keymap_from_section ("panel", panel_keymap, mc_global_keymap); + mc_config_deinit(mc_global_keymap); } -- 2.11.4.GIT