From beb13fa4cce89e2ae403fb60f8ca5ad8de5b70fa Mon Sep 17 00:00:00 2001 From: Hidetoshi Tajima Date: Thu, 18 Oct 2001 22:35:15 +0000 Subject: [PATCH] Support "*" for all locales with least priority when to select default im * gtk/gtkimmodule.c (match_locale): Support "*" for all locales with least priority when to select default im module, #58201 --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkimmodule.c | 14 +++++++++----- 8 files changed, 51 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 071cd05466..af15c915b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 071cd05466..af15c915b0 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 071cd05466..af15c915b0 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 071cd05466..af15c915b0 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 071cd05466..af15c915b0 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 071cd05466..af15c915b0 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 071cd05466..af15c915b0 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2001-10-18 HideToshi Tajima + + * gtk/gtkimmodule.c (match_locale): + Support "*" for all locales with least priority + when to select default im module, #58201 + 2001-10-18 Matthias Clasen * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c index 7d882a293e..1086d9fc6d 100644 --- a/gtk/gtkimmodule.c +++ b/gtk/gtkimmodule.c @@ -441,20 +441,24 @@ _gtk_im_module_create (const gchar *context_id) /* Match @locale against @against. * - * 'en_US' against 'en_US' => 3 - * 'en_US' against 'en' => 2 - * 'en', 'en_UK' against 'en_US' => 1 + * 'en_US' against 'en_US' => 4 + * 'en_US' against 'en' => 3 + * 'en', 'en_UK' against 'en_US' => 2 + * all locales, against '*' => 1 */ static gint match_locale (const gchar *locale, const gchar *against, gint against_len) { + if (strcmp (against, "*") == 0) + return 1; + if (strcmp (locale, against) == 0) - return 3; + return 4; if (strncmp (locale, against, 2) == 0) - return (against_len == 2) ? 2 : 1; + return (against_len == 2) ? 3 : 2; return 0; }