diff options
author | Stefano Karapetsas <[email protected]> | 2012-10-25 00:38:52 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-10-25 00:38:52 +0200 |
commit | 3bb2d6c2e4c434cd7852eddfac5256ad807f4da4 (patch) | |
tree | 452af6284ea78095594a297132048d316e36488b /capplets/keyboard/mate-keyboard-properties-xkbltadd.c | |
parent | fdbdbecabce4115565a3beaeeb96486e1e5fdb28 (diff) | |
download | mate-control-center-3bb2d6c2e4c434cd7852eddfac5256ad807f4da4.tar.bz2 mate-control-center-3bb2d6c2e4c434cd7852eddfac5256ad807f4da4.tar.xz |
migrate keyboard applet to gsettings
Diffstat (limited to 'capplets/keyboard/mate-keyboard-properties-xkbltadd.c')
-rw-r--r-- | capplets/keyboard/mate-keyboard-properties-xkbltadd.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/capplets/keyboard/mate-keyboard-properties-xkbltadd.c b/capplets/keyboard/mate-keyboard-properties-xkbltadd.c index fe7f79df..1af72bb5 100644 --- a/capplets/keyboard/mate-keyboard-properties-xkbltadd.c +++ b/capplets/keyboard/mate-keyboard-properties-xkbltadd.c @@ -366,6 +366,33 @@ xkb_layout_chooser_available_layouts_fill (GtkBuilder * chooser_dialog); } +GSList* +xkb_layout_gslist_from_strv (gchar **array) +{ + GSList *list = NULL; + gint i; + if (array != NULL) { + for (i = 0; array[i]; i++) { + list = g_slist_append (list, g_strdup (array[i])); + } + } + return list; +} + +gchar ** +xkb_layout_strv_from_gslist (GSList *list) +{ + GArray *array; + GSList *l; + array = g_array_new (TRUE, TRUE, sizeof (gchar *)); + for (l = list; l; l = l->next) { + array = g_array_append_val (array, l->data); + } + return (gchar **) array->data; +} + + + void xkl_layout_chooser_add_default_switcher_if_necessary (GSList * layouts_list) @@ -373,11 +400,16 @@ xkl_layout_chooser_add_default_switcher_if_necessary (GSList * GSList *options_list = xkb_options_get_selected_list (); gboolean was_appended; - options_list = + gchar **layouts_list_strv = xkb_layout_strv_from_gslist (layouts_list); + gchar **options_list_strv = xkb_layout_strv_from_gslist (options_list); + + options_list_strv = matekbd_keyboard_config_add_default_switch_option_if_necessary - (layouts_list, options_list, &was_appended); - if (was_appended) + (layouts_list_strv, options_list_strv, &was_appended); + if (was_appended) { xkb_options_set_selected_list (options_list); + + } clear_xkb_elements_list (options_list); } |