[libgnomekbd] Do not put the tab into merged string if variant is empty



commit 9e641dbb82242a450aaabcba3b052e694fd0fadb
Author: Sergey V. Udaltsov <svu gnome org>
Date:   Sun Apr 18 19:34:05 2010 +0100

    Do not put the tab into merged string if variant is empty
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613775

 libgnomekbd/gkbd-keyboard-config.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libgnomekbd/gkbd-keyboard-config.c b/libgnomekbd/gkbd-keyboard-config.c
index d974b1f..29c0c87 100644
--- a/libgnomekbd/gkbd-keyboard-config.c
+++ b/libgnomekbd/gkbd-keyboard-config.c
@@ -134,6 +134,7 @@ const gchar *
 gkbd_keyboard_config_merge_items (const gchar * parent,
 				  const gchar * child)
 {
+	printf("p:[%s](%p), c:[%s](%p)\n", parent, parent, child, child);
 	static gchar buffer[XKL_MAX_CI_NAME_LENGTH * 2 - 1];
 	*buffer = '\0';
 	if (parent != NULL) {
@@ -141,7 +142,7 @@ gkbd_keyboard_config_merge_items (const gchar * parent,
 			return NULL;
 		strcat (buffer, parent);
 	}
-	if (child != NULL) {
+	if (child != NULL && *child != 0) {
 		if (strlen (child) >= XKL_MAX_CI_NAME_LENGTH)
 			return NULL;
 		strcat (buffer, "\t");
@@ -518,6 +519,7 @@ gkbd_keyboard_config_load_from_x_current (GkbdKeyboardConfig * kbd_config,
 					  XklConfigRec * data)
 {
 	gboolean own_data = data == NULL;
+	xkl_debug(150, "Copying config from X(current)\n");
 	if (own_data)
 		data = xkl_config_rec_new ();
 	if (xkl_config_rec_get_from_server (data, kbd_config->engine))
@@ -536,6 +538,7 @@ gkbd_keyboard_config_load_from_x_initial (GkbdKeyboardConfig * kbd_config,
 					  XklConfigRec * data)
 {
 	gboolean own_data = data == NULL;
+	xkl_debug(150, "Copying config from X(initial)\n");
 	if (own_data)
 		data = xkl_config_rec_new ();
 	if (xkl_config_rec_get_from_backup (data, kbd_config->engine))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]