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
This commit is contained in:
Hidetoshi Tajima 2001-10-18 22:35:15 +00:00
parent 4e3ec88326
commit beb13fa4cc
8 changed files with 51 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -1,3 +1,9 @@
2001-10-18 HideToshi Tajima <hidetoshi.tajima@sun.com>
* gtk/gtkimmodule.c (match_locale):
Support "*" for all locales with least priority
when to select default im module, #58201
2001-10-18 Matthias Clasen <matthiasc@poet.de> 2001-10-18 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): * gtk/gtktreeselection.c (gtk_tree_selection_set_mode):

View File

@ -441,20 +441,24 @@ _gtk_im_module_create (const gchar *context_id)
/* Match @locale against @against. /* Match @locale against @against.
* *
* 'en_US' against 'en_US' => 3 * 'en_US' against 'en_US' => 4
* 'en_US' against 'en' => 2 * 'en_US' against 'en' => 3
* 'en', 'en_UK' against 'en_US' => 1 * 'en', 'en_UK' against 'en_US' => 2
* all locales, against '*' => 1
*/ */
static gint static gint
match_locale (const gchar *locale, match_locale (const gchar *locale,
const gchar *against, const gchar *against,
gint against_len) gint against_len)
{ {
if (strcmp (against, "*") == 0)
return 1;
if (strcmp (locale, against) == 0) if (strcmp (locale, against) == 0)
return 3; return 4;
if (strncmp (locale, against, 2) == 0) if (strncmp (locale, against, 2) == 0)
return (against_len == 2) ? 2 : 1; return (against_len == 2) ? 3 : 2;
return 0; return 0;
} }