[gcompris/gcomprixogoo] Cleanup of the usage of gc_locale_set



commit 5d9c4f1e8af6636cb620d22bba19afbf49c8ea76
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Wed Feb 17 01:12:19 2010 +0100

    Cleanup of the usage of gc_locale_set
    
    In several places, call was done to gc_locale_set
    instead of gc_locale_change.
    The API is very confusing. In fact, gc_locale_change keep
    the locale for the next call to gc_locale_reset.

 src/babymatch-activity/shapegame.c             |    4 +---
 src/click_on_letter-activity/click_on_letter.c |    3 +--
 src/colors-activity/colors.c                   |    1 -
 src/electric-activity/electric.py              |    2 --
 src/gletters-activity/gletters.c               |    4 +---
 src/guessnumber-activity/guessnumber.py        |    2 --
 src/imageid-activity/imageid.c                 |    4 +---
 src/missing_letter-activity/missingletter.c    |    4 +---
 src/mosaic-activity/mosaic.py                  |    2 --
 src/readingh-activity/reading.c                |    4 +---
 src/wordsgame-activity/wordsgame.c             |    2 --
 11 files changed, 6 insertions(+), 26 deletions(-)
---
diff --git a/src/babymatch-activity/shapegame.c b/src/babymatch-activity/shapegame.c
index f15f5a2..d85ebcb 100644
--- a/src/babymatch-activity/shapegame.c
+++ b/src/babymatch-activity/shapegame.c
@@ -220,7 +220,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
   GHashTable *config = gc_db_get_board_conf();
 
   if (strcmp(agcomprisBoard->name, "imagename")==0){
-    gc_locale_set(g_hash_table_lookup( config, "locale"));
+    gc_locale_change(g_hash_table_lookup( config, "locale"));
   }
 
   gchar *drag_mode_str = g_hash_table_lookup( config, "drag_mode");
@@ -1797,8 +1797,6 @@ static void conf_ok(GHashTable *table)
       config = table;
 
     if (strcmp(gcomprisBoard->name, "imagename")==0){
-      gc_locale_reset();
-
       gc_locale_set(g_hash_table_lookup( config, "locale"));
     }
 
diff --git a/src/click_on_letter-activity/click_on_letter.c b/src/click_on_letter-activity/click_on_letter.c
index 8a1457c..616320c 100644
--- a/src/click_on_letter-activity/click_on_letter.c
+++ b/src/click_on_letter-activity/click_on_letter.c
@@ -141,7 +141,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
 
   board_paused = TRUE;
 
-  gc_locale_set(g_hash_table_lookup( config, "locale_sound"));
+  gc_locale_change(g_hash_table_lookup( config, "locale_sound"));
 
   gchar *up_init_str = g_hash_table_lookup( config, "uppercase_only");
 
@@ -584,7 +584,6 @@ conf_ok(GHashTable *table)
     else
       config = table;
 
-    gc_locale_reset();
     gc_locale_set(g_hash_table_lookup(config, "locale_sound"));
 
     gchar *up_init_str = g_hash_table_lookup( config, "uppercase_only");
diff --git a/src/colors-activity/colors.c b/src/colors-activity/colors.c
index fdb5b5e..62a8cf2 100644
--- a/src/colors-activity/colors.c
+++ b/src/colors-activity/colors.c
@@ -139,7 +139,6 @@ conf_ok(GHashTable *table)
     else
       config = table;
 
-    gc_locale_reset();
     gc_locale_set(g_hash_table_lookup(config, "locale_sound"));
 
     if (profile_conf)
diff --git a/src/electric-activity/electric.py b/src/electric-activity/electric.py
index 197473d..e9251a6 100644
--- a/src/electric-activity/electric.py
+++ b/src/electric-activity/electric.py
@@ -101,8 +101,6 @@ class Gcompris_electric:
 
   def end(self):
 
-    gcompris.reset_locale()
-
     gcompris.set_cursor(gcompris.CURSOR_DEFAULT);
 
     # Remove the root item removes all the others inside it
diff --git a/src/gletters-activity/gletters.c b/src/gletters-activity/gletters.c
index 987e483..5c2892d 100644
--- a/src/gletters-activity/gletters.c
+++ b/src/gletters-activity/gletters.c
@@ -289,7 +289,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
 {
   GHashTable *config = gc_db_get_board_conf();
 
-  gc_locale_set(g_hash_table_lookup( config, "locale"));
+  gc_locale_change(g_hash_table_lookup( config, "locale"));
 
   gchar *up_init_str = g_hash_table_lookup( config, "uppercase_only");
 
@@ -795,8 +795,6 @@ static void conf_ok(GHashTable *table)
   g_hash_table_foreach(table, save_table, NULL);
 
   if (gcomprisBoard){
-    gc_locale_reset();
-
     GHashTable *config;
 
     if (profile_conf)
diff --git a/src/guessnumber-activity/guessnumber.py b/src/guessnumber-activity/guessnumber.py
index 2b41c9d..1bf13d6 100644
--- a/src/guessnumber-activity/guessnumber.py
+++ b/src/guessnumber-activity/guessnumber.py
@@ -96,8 +96,6 @@ class Gcompris_guessnumber:
 
   def end(self):
 
-    gcompris.reset_locale()
-
     # Remove the root item removes all the others inside it
     self.cleanup_game()
 
diff --git a/src/imageid-activity/imageid.c b/src/imageid-activity/imageid.c
index 7f13402..3dcc6bd 100644
--- a/src/imageid-activity/imageid.c
+++ b/src/imageid-activity/imageid.c
@@ -145,7 +145,7 @@ start_board (GcomprisBoard *agcomprisBoard)
   gchar *filename = NULL;
   GHashTable *config = gc_db_get_board_conf();
 
-  gc_locale_set(g_hash_table_lookup( config, "locale"));
+  gc_locale_change(g_hash_table_lookup( config, "locale"));
 
   g_hash_table_destroy(config);
 
@@ -673,8 +673,6 @@ static GcomprisConfCallback conf_ok(GHashTable *table)
   g_hash_table_foreach(table, (GHFunc) save_table, NULL);
 
   if (gcomprisBoard) {
-    gc_locale_reset();
-
     GHashTable *config;
 
     if (profile_conf)
diff --git a/src/missing_letter-activity/missingletter.c b/src/missing_letter-activity/missingletter.c
index 06fb38a..a6e164a 100644
--- a/src/missing_letter-activity/missingletter.c
+++ b/src/missing_letter-activity/missingletter.c
@@ -153,7 +153,7 @@ start_board (GcomprisBoard *agcomprisBoard)
 {
   GHashTable *config = gc_db_get_board_conf();
 
-  gc_locale_set(g_hash_table_lookup( config, "locale"));
+  gc_locale_change(g_hash_table_lookup( config, "locale"));
 
   g_hash_table_destroy(config);
 
@@ -702,8 +702,6 @@ conf_ok(GHashTable *table)
   g_hash_table_foreach(table, (GHFunc) save_table, NULL);
 
   if (gcomprisBoard_missing){
-    gc_locale_reset();
-
     GHashTable *config;
 
     if (profile_conf)
diff --git a/src/mosaic-activity/mosaic.py b/src/mosaic-activity/mosaic.py
index 4477e9c..22da4e1 100644
--- a/src/mosaic-activity/mosaic.py
+++ b/src/mosaic-activity/mosaic.py
@@ -102,8 +102,6 @@ class Gcompris_mosaic:
 
   def end(self):
 
-    gcompris.reset_locale()
-
     # Remove the root item removes all the others inside it
     self.cleanup_game()
 
diff --git a/src/readingh-activity/reading.c b/src/readingh-activity/reading.c
index 73f85a1..821c9a6 100644
--- a/src/readingh-activity/reading.c
+++ b/src/readingh-activity/reading.c
@@ -169,7 +169,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
 {
   GHashTable *config = gc_db_get_board_conf();
 
-  gc_locale_set(g_hash_table_lookup( config, "locale"));
+  gc_locale_change(g_hash_table_lookup( config, "locale"));
 
   g_hash_table_destroy(config);
 
@@ -842,8 +842,6 @@ static void conf_ok(GHashTable *table)
   g_hash_table_foreach(table, (GHFunc) save_table, NULL);
 
   if (gcomprisBoard){
-    gc_locale_reset();
-
     GHashTable *config;
 
     if (profile_conf)
diff --git a/src/wordsgame-activity/wordsgame.c b/src/wordsgame-activity/wordsgame.c
index 5768545..f451305 100644
--- a/src/wordsgame-activity/wordsgame.c
+++ b/src/wordsgame-activity/wordsgame.c
@@ -792,8 +792,6 @@ static void conf_ok(GHashTable *table)
   g_hash_table_foreach(table, (GHFunc) save_table, NULL);
 
   if (gcomprisBoard){
-    gc_locale_reset();
-
     GHashTable *config;
 
     if (profile_conf)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]