[libgnomekbd] The latest changes in xk-c: variants contain full descriptions



commit 7619974c84fe0f83b5ffead20ad15975943ab53b
Author: Sergey V. Udaltsov <svu gnome org>
Date:   Tue Mar 1 11:30:38 2011 +0000

    The latest changes in xk-c: variants contain full descriptions
    
    The formatting of the visible strings changes: no need to prepend the layout
    description to the variant description.

 libgnomekbd/gkbd-desktop-config.c  |    9 +++++----
 libgnomekbd/gkbd-keyboard-config.c |   15 ++++++---------
 libgnomekbd/gkbd-keyboard-config.h |   25 +++++++++++++------------
 3 files changed, 24 insertions(+), 25 deletions(-)
---
diff --git a/libgnomekbd/gkbd-desktop-config.c b/libgnomekbd/gkbd-desktop-config.c
index beddec1..f3f6181 100644
--- a/libgnomekbd/gkbd-desktop-config.c
+++ b/libgnomekbd/gkbd-desktop-config.c
@@ -297,11 +297,12 @@ gkbd_desktop_config_load_group_descriptions (GkbdDesktopConfig
 	plvd = lvd;
 	psvd = svd;
 	while (plld != NULL && *plld != NULL) {
-		gchar *sd = (*psvd[0] == '\0') ? *psld : *psvd;
+		*psgn++ = g_strdup ((*psvd[0] == '\0') ? *psld : *psvd);
+		*pfgn++ =
+		    g_strdup (gkbd_keyboard_config_format_full_description
+			      (*plld++, *plvd++));
 		psld++, psvd++;
-		*psgn++ = g_strdup (sd);
-		*pfgn++ = g_strdup (gkbd_keyboard_config_format_full_layout
-				    (*plld++, *plvd++));
+		plld++, plvd++;
 	}
 	g_strfreev (sld);
 	g_strfreev (lld);
diff --git a/libgnomekbd/gkbd-keyboard-config.c b/libgnomekbd/gkbd-keyboard-config.c
index fa562f9..96c88a6 100644
--- a/libgnomekbd/gkbd-keyboard-config.c
+++ b/libgnomekbd/gkbd-keyboard-config.c
@@ -343,7 +343,8 @@ gkbd_keyboard_config_load_params (GkbdKeyboardConfig * kbd_config,
 	kbd_config->layouts_variants =
 	    g_settings_get_strv (kbd_config->settings, param_names[1]);
 
-	if (kbd_config->layouts_variants != NULL && kbd_config->layouts_variants[0] == NULL) {
+	if (kbd_config->layouts_variants != NULL
+	    && kbd_config->layouts_variants[0] == NULL) {
 		g_strfreev (kbd_config->layouts_variants);
 		kbd_config->layouts_variants = NULL;
 	}
@@ -661,17 +662,13 @@ gkbd_keyboard_config_get_descriptions (XklConfigRegistry * config_registry,
 }
 
 const gchar *
-gkbd_keyboard_config_format_full_layout (const gchar * layout_descr,
-					 const gchar * variant_descr)
+gkbd_keyboard_config_format_full_description (const gchar * layout_descr,
+					      const gchar * variant_descr)
 {
-	static gchar full_descr[XKL_MAX_CI_DESC_LENGTH * 2];
 	if (variant_descr == NULL || variant_descr[0] == 0)
-		g_snprintf (full_descr, sizeof (full_descr), "%s",
-			    layout_descr);
+		return layout_descr;
 	else
-		g_snprintf (full_descr, sizeof (full_descr), "%s %s",
-			    layout_descr, variant_descr);
-	return full_descr;
+		return variant_descr;
 }
 
 gchar *
diff --git a/libgnomekbd/gkbd-keyboard-config.h b/libgnomekbd/gkbd-keyboard-config.h
index e16effd..99ecac6 100644
--- a/libgnomekbd/gkbd-keyboard-config.h
+++ b/libgnomekbd/gkbd-keyboard-config.h
@@ -102,22 +102,23 @@ extern gboolean gkbd_keyboard_config_get_descriptions (XklConfigRegistry *
 						       gchar **
 						       variant_descr);
 
-extern const gchar *gkbd_keyboard_config_format_full_layout (const gchar
-							     *
-							     layout_descr,
-							     const gchar *
-							     variant_descr);
+extern const gchar *gkbd_keyboard_config_format_full_description (const
+								  gchar *
+								  layout_descr,
+								  const
+								  gchar *
+								  variant_descr);
 
 extern gchar *gkbd_keyboard_config_to_string (const GkbdKeyboardConfig *
 					      config);
 
 extern gchar
-    **gkbd_keyboard_config_add_default_switch_option_if_necessary (gchar **
-								   layouts_list,
-								   gchar **
-								   options_list,
-								   gboolean
-								   *
-								   was_appended);
+    **
+gkbd_keyboard_config_add_default_switch_option_if_necessary (gchar **
+							     layouts_list,
+							     gchar **
+							     options_list,
+							     gboolean *
+							     was_appended);
 
 #endif



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