[Xfce4-commits] <xfce4-settings:master> keyboard: Fix handling of empty variants

Jérôme Guelfucci noreply at xfce.org
Fri Oct 8 15:50:01 CEST 2010


Updating branch refs/heads/master
         to a5f79b94560bce65142ab262fa2f3113fec6d981 (commit)
       from 894db1cd351bcfe647c637ca61b4deb56ff025ff (commit)

commit a5f79b94560bce65142ab262fa2f3113fec6d981
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Fri Oct 8 15:34:03 2010 +0200

    keyboard: Fix handling of empty variants
    
    Layouts with empty variants give us a NULL variant in the tree iterator, which
    gives wrong results when being g_strconcat'ed together to form the final
    variant list. If we encounter a NULL variant, set it to the empty string now.
    
    http://bugzilla.xfce.org/show_bug.cgi?id=6727

 dialogs/keyboard-settings/xfce-keyboard-settings.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dialogs/keyboard-settings/xfce-keyboard-settings.c b/dialogs/keyboard-settings/xfce-keyboard-settings.c
index 2de5f78..bc3c336 100644
--- a/dialogs/keyboard-settings/xfce-keyboard-settings.c
+++ b/dialogs/keyboard-settings/xfce-keyboard-settings.c
@@ -1029,6 +1029,8 @@ xfce_keyboard_settings_set_layout (XfceKeyboardSettings *settings)
   gtk_tree_model_get (model, &iter,
                       XKB_TREE_LAYOUTS, &val_layout,
                       XKB_TREE_VARIANTS, &val_variant, -1);
+  if (val_variant == NULL)
+      val_variant = g_strdup("");
 
   /* We put the active layout/variant at the beginning of the list so that it gets
    * picked by xfce4-settings-helper on the next session start. */
@@ -1056,6 +1058,8 @@ xfce_keyboard_settings_set_layout (XfceKeyboardSettings *settings)
       gtk_tree_model_get (model, &iter,
                           XKB_TREE_LAYOUTS, &val_layout,
                           XKB_TREE_VARIANTS, &val_variant, -1);
+      if (val_variant == NULL)
+          val_variant = g_strdup("");
 
       if (gtk_tree_selection_iter_is_selected (selection, &iter))
         {



More information about the Xfce4-commits mailing list