[gcompris] core: bug fix, in case an actvity is removed from GCompris, the wrong activity is removed from the d
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] core: bug fix, in case an actvity is removed from GCompris, the wrong activity is removed from the d
- Date: Tue, 28 Aug 2012 19:29:05 +0000 (UTC)
commit 7b8486fc4761e04debea3b24c9ee3f72da79dcff
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Tue Aug 28 21:27:36 2012 +0200
core: bug fix, in case an actvity is removed from GCompris, the wrong activity is removed from the database.
src/gcompris/menu.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/gcompris/menu.c b/src/gcompris/menu.c
index 2999500..2630ad4 100644
--- a/src/gcompris/menu.c
+++ b/src/gcompris/menu.c
@@ -28,6 +28,9 @@
#include "gcompris.h"
#include "status.h"
+#define IS_ADMIN(board) ( ( strncmp(board->section, "/administration", \
+ strlen("/administration")) == 0 ) )
+
static GcomprisBoard *gc_menu_load_board(const gchar*, const gchar*, gboolean);
GcomprisBoard *_read_xml_file(GcomprisBoard *gcomprisBoard, char *fname, gboolean db);
@@ -551,8 +554,12 @@ void gc_menu_load_dir(char *dirname, gboolean db){
/* add the board to the list */
GcomprisBoard *board = gc_menu_load_board(dirname, one_dirent, db);
if (board) {
- board->board_id = new_board_id++;
- list_old_boards_id = suppress_int_from_list(list_old_boards_id, board->board_id);
+ if ( ! board->board_id )
+ // If there is no datadase, let's give an id here
+ board->board_id = new_board_id++;
+
+ if ( ! IS_ADMIN(board) )
+ list_old_boards_id = suppress_int_from_list(list_old_boards_id, board->board_id);
}
}
}
@@ -600,9 +607,7 @@ static GcomprisBoard *gc_menu_load_board(const gchar *dirname,
if (properties->administration)
boards_list = g_list_append(boards_list, board_read);
else {
- if ((strncmp(board_read->section,
- "/administration",
- strlen("/administration"))!=0)) {
+ if ( ! IS_ADMIN(board_read) ) {
boards_list = g_list_append(boards_list, board_read);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]