[Xfce4-commits] <xfce4-xkb-plugin:master> Fix error with incorrect handling variants (bug #8255 by Ivan Romanov)

Azamat H. Hackimov noreply at xfce.org
Fri Jan 6 23:26:01 CET 2012


Updating branch refs/heads/master
         to f80ece9da08f15efd5d1e5f2c78e400664707ed6 (commit)
       from c158d3f5514e4f7ca1c69f76f3abeb3bd05a6ee8 (commit)

commit f80ece9da08f15efd5d1e5f2c78e400664707ed6
Author: Azamat H. Hackimov <azamat.hackimov at gmail.com>
Date:   Sat Jan 7 04:23:56 2012 +0600

    Fix error with incorrect handling variants (bug #8255 by Ivan Romanov)

 ChangeLog                 |    6 +++++-
 configure.in.in           |    2 +-
 panel-plugin/xkb-config.c |   21 ++++++++++++++++++++-
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6bc3971..d7b5e93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
+2012-01-07 04:18  winterheart
+	* New version 0.5.4.3
+	* Fix error with incorrect handling variants (bug #8255 by Ivan Romanov)
+
 2011-11-04 20:42  winterheart
-	* Text size on icon is noew adjustable (bug #6703 by Rinat)
+	* Text size on icon is now adjustable (bug #6703 by Rinat)
 	* New flag: Cambodia (request from Janne Snabb)
 
 2011-10-15 18:54  winterheart
diff --git a/configure.in.in b/configure.in.in
index 0dfebd2..35d88e9 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -19,7 +19,7 @@ m4_define([xkb_version], [xkb_version_major().xkb_version_minor().xkb_version_mi
 dnl ***************************
 dnl *** Initialize autoconf ***
 dnl ***************************
-AC_COPYRIGHT([Copyright (c) 2006-2011
+AC_COPYRIGHT([Copyright (c) 2006-2012
         The Xfce development team. All rights reserved.])
 AC_INIT([xfce4-xkb-plugin], [xkb_version], [http://bugzilla.xfce.org/], [xfce4-xkb-plugin])
 AC_PREREQ([2.50])
diff --git a/panel-plugin/xkb-config.c b/panel-plugin/xkb-config.c
index 22f771d..2c5af77 100644
--- a/panel-plugin/xkb-config.c
+++ b/panel-plugin/xkb-config.c
@@ -314,8 +314,27 @@ xkb_config_update_settings (t_xkb_settings *settings)
         settings->kbd_config->model = g_strdup (config->config_rec->model);
         g_free (settings->kbd_config->layouts);
         settings->kbd_config->layouts = g_strjoinv (",", config->config_rec->layouts);
+
+        /* XklConfigRec uses for NULL for empty variant instead of "".
+         * So if has skipped variants we can't get proper settings->kbd_config->variants.
+         * So I use this hack to get proper kbd_config->variants */
+        gchar *tmp1 = g_strdup("");
+        gchar *tmp2 = NULL;
+        int i;
+        for (i = 0; config->config_rec->layouts[i]; i++)
+        {
+            tmp2 = g_strconcat (tmp1, config->config_rec->variants[i] ? config->config_rec->variants[i] : "", NULL);
+            g_free(tmp1);
+            tmp1 = tmp2;
+            if (config->config_rec->layouts[i + 1])
+            {
+                tmp2 = g_strconcat (tmp1, ",", NULL);
+                g_free(tmp1);
+                tmp1 = tmp2;
+            }
+        }
         g_free (settings->kbd_config->variants);
-        settings->kbd_config->variants = g_strjoinv (",", config->config_rec->variants);
+        settings->kbd_config->variants = tmp2;
     }
     else
     {


More information about the Xfce4-commits mailing list