[gcompris/gcomprixogoo] Cleanup, removed unused concept of activity board_dir



commit fd87a0a9c5080df8e558dbded985487e29cbddae
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Fri Dec 10 22:44:45 2010 +0100

    Cleanup, removed unused concept of activity board_dir
    
    This concept is no more use. Now we use the concept of a global
    package_data_dir found in the properties.

 src/boards/menu2.c            |   10 ----------
 src/boards/python.c           |   12 +-----------
 src/gcompris/gcompris-board.h |    3 ---
 src/gcompris/gcompris_db.c    |   10 ----------
 src/gcompris/menu.c           |    2 --
 5 files changed, 1 insertions(+), 36 deletions(-)
---
diff --git a/src/boards/menu2.c b/src/boards/menu2.c
index e8b4261..2105942 100644
--- a/src/boards/menu2.c
+++ b/src/boards/menu2.c
@@ -474,19 +474,9 @@ static void menu_create_item(GooCanvasItem *parent, MenuItems *menuitems, Gcompr
   GdkPixbuf *menu_pixmap = NULL;
   GooCanvasItem *menu_button;
   int difficulty;
-  gchar *tmp_board_dir;
   gdouble ratio, pixmap_w, pixmap_h;
 
-  /*
-   * Take care to load the board->icon_name from the dir specified
-   * in the board->board_dir
-   * To make it simple and reuse the gc_pixmap_load, we overwrite temporarily
-   * the gcomprisBoard->board_dir and board->board_dir
-   */
-  tmp_board_dir = gcomprisBoard->board_dir;
-  gcomprisBoard->board_dir = board->board_dir;
   menu_pixmap = gc_pixmap_load(board->icon_name);
-  gcomprisBoard->board_dir = tmp_board_dir;
 
   ratio = get_ratio (menu_pixmap, icon_size);
 
diff --git a/src/boards/python.c b/src/boards/python.c
index 98ac188..ac72429 100644
--- a/src/boards/python.c
+++ b/src/boards/python.c
@@ -208,8 +208,7 @@ init_config_boards()
 
     /* Test if board come with --python_plugin_dir option */
 
-    g_message("board_dir: '%s' python_plugin_dir '%s' file_name '%s'",
-	      board->board_dir,
+    g_message("python_plugin_dir '%s' file_name '%s'",
 	      properties->package_python_plugin_dir,
 	      board_file_name);
 
@@ -357,15 +356,6 @@ pythonboard_start (GcomprisBoard *agcomprisBoard){
     g_free(boarddir);
 
 
-    /* Test if board come with -L option */
-    if (strcmp(gcomprisBoard->board_dir, properties->package_data_dir)!=0){
-      boarddir = g_strdup_printf("sys.path.append('%s/../python/')", gcomprisBoard->board_dir);
-
-      PyRun_SimpleString(boarddir);
-      g_free(boarddir);
-    }
-
-
     /* Load the gcompris modules */
     python_gcompris_module_init();
 
diff --git a/src/gcompris/gcompris-board.h b/src/gcompris/gcompris-board.h
index fece57f..5e5d0d8 100644
--- a/src/gcompris/gcompris-board.h
+++ b/src/gcompris/gcompris-board.h
@@ -29,9 +29,6 @@ struct _GcomprisBoard
   gchar               *type;
   gboolean	       board_ready;
 
-  /* The directory from which it was started */
-  gchar		      *board_dir;
-
   /* Board specific mode */
   gchar		      *mode;
 
diff --git a/src/gcompris/gcompris_db.c b/src/gcompris/gcompris_db.c
index 1f00e89..0ad4453 100644
--- a/src/gcompris/gcompris_db.c
+++ b/src/gcompris/gcompris_db.c
@@ -827,8 +827,6 @@ GList *gc_menu_load_db(GList *boards_list)
 
 #ifdef USE_SQLITE
 
-  GcomprisProperties	*properties = gc_prop_get();
-
   GList *boards = boards_list;
 
   char *zErrMsg;
@@ -866,9 +864,6 @@ GList *gc_menu_load_db(GList *boards_list)
     gcomprisBoard->gmodule      = NULL;
     gcomprisBoard->gmodule_file = NULL;
 
-    /* From DB we have only package_data_dir. */
-    gcomprisBoard->board_dir = g_strdup(properties->package_data_dir);
-
     gcomprisBoard->board_id = atoi(result[i++]);
     gcomprisBoard->name = g_strdup(result[i++]);
     gcomprisBoard->section_id = atoi(result[i++]);
@@ -1878,8 +1873,6 @@ GcomprisBoard *gc_db_get_board_from_id(int board_id)
 
 #ifdef USE_SQLITE
 
-  GcomprisProperties	*properties = gc_prop_get();
-
   char *zErrMsg;
   char **result;
   int rc;
@@ -1920,9 +1913,6 @@ GcomprisBoard *gc_db_get_board_from_id(int board_id)
   gcomprisBoard->gmodule      = NULL;
   gcomprisBoard->gmodule_file = NULL;
 
-  /* From DB we have only package_data_dir. */
-  gcomprisBoard->board_dir = g_strdup(properties->package_data_dir);
-
   gcomprisBoard->board_id = board_id;
   gcomprisBoard->name = g_strdup(result[i++]);
   gcomprisBoard->section_id = atoi(result[i++]);
diff --git a/src/gcompris/menu.c b/src/gcompris/menu.c
index a1a364b..988cee9 100644
--- a/src/gcompris/menu.c
+++ b/src/gcompris/menu.c
@@ -554,7 +554,6 @@ void gc_menu_load_dir(char *dirname, gboolean db){
 
       if(file_end_with_xml(one_dirent)) {
 	gcomprisBoard = g_malloc0 (sizeof (GcomprisBoard));
-	gcomprisBoard->board_dir = g_strdup(dirname);
 
 	/* Need to be initialized here because _read_xml_file is used also to reread 	*/
 	/* the locale data									*/
@@ -670,7 +669,6 @@ void gc_menu_load()
 void gc_menu_board_free(GcomprisBoard *board)
 {
     g_free(board->type);
-    g_free(board->board_dir);
     g_free(board->mode);
 
     g_free(board->name);



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