Don't add empty modes in kioskmode.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 1 Dec 2014 23:34:11 +0000 (00:34 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 1 Dec 2014 23:34:11 +0000 (00:34 +0100)
It does not disturb to have modes with never called callbacks, so save the
condition and the additional code block and setup the modes like normal.

src/main.c

index 7384d34..fe4f24b 100644 (file)
@@ -836,17 +836,10 @@ static void init_core(void)
 
     /* initialize the modes */
     mode_init();
-    if (!vb.config.kioskmode) {
-        mode_add('n', normal_enter, normal_leave, normal_keypress, NULL);
-        mode_add('c', ex_enter, ex_leave, ex_keypress, ex_input_changed);
-        mode_add('i', input_enter, input_leave, input_keypress, NULL);
-        mode_add('p', pass_enter, pass_leave, pass_keypress, NULL);
-    } else {
-        mode_add('n', NULL, NULL, NULL, NULL);
-        mode_add('c', NULL, NULL, NULL, NULL);
-        mode_add('i', NULL, NULL, NULL, NULL);
-        mode_add('p', NULL, NULL, NULL, NULL);
-    }
+    mode_add('n', normal_enter, normal_leave, normal_keypress, NULL);
+    mode_add('c', ex_enter, ex_leave, ex_keypress, ex_input_changed);
+    mode_add('i', input_enter, input_leave, input_keypress, NULL);
+    mode_add('p', pass_enter, pass_leave, pass_keypress, NULL);
 
     /* initialize the marks with empty values */
     marks_clear();