Commit 8b835f76 authored by Yves Combe's avatar Yves Combe
Browse files

new version was not written in the db when reread boards because of version change.

parent d7c53719
2005-09-13 Yves Combe,,, <yves@ycombe.net>
new version was not written in the db when reread boards because of version change.
* src/gcompris/gameutil.c: (gcompris_load_menus):
* src/gcompris/gcompris_db.c: (gcompris_db_set_version):
* src/gcompris/gcompris_db.h:
2005-09-13 Yves Combe <yves@ycombe.net>
change background with level, to make level change visible.
......
/* gcompris - gameutil.c
*
* Time-stamp: <2005/09/11 18:12:34 bruno>
* Time-stamp: <2005/09/13 23:02:09 yves>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -903,6 +903,7 @@ void gcompris_load_menus()
gchar date[11];
g_date_strftime (date, 11, "%F", today);
gcompris_db_set_date(date);
gcompris_db_set_version(VERSION);
g_date_free(today);
}
......
......@@ -334,6 +334,39 @@ void gcompris_db_set_date(gchar *date)
#endif
}
#define BOARDS_UPDATE_VERSION(version) \
"UPDATE informations SET gcompris_version=\'%s\';",version
void gcompris_db_set_version(gchar *version)
{
#ifdef USE_SQLITE
char *zErrMsg;
char **result;
int rc;
int nrow;
int ncolumn;
gboolean ret_value;
gchar *request;
request = g_strdup_printf(BOARDS_UPDATE_VERSION(version));
rc = sqlite3_get_table(gcompris_db,
request,
&result,
&nrow,
&ncolumn,
&zErrMsg
);
if( rc!=SQLITE_OK ){
g_error("SQL error: %s\n", zErrMsg);
}
g_free(request);
sqlite3_free_table(result);
#endif
}
#define BOARDS_CHECK \
"SELECT gcompris_version, init_date FROM informations;"
gboolean gcompris_db_check_boards()
......
/* gcompris - gcompris_db.h
*
* Time-stamp: <2005/08/20 23:44:47 yves>
* Time-stamp: <2005/09/13 22:57:36 yves>
*
* Copyright (C) 2005 Bruno Coudoin
*
......@@ -35,6 +35,8 @@ gboolean gcompris_db_check_boards();
void gcompris_db_set_date(gchar *date);
void gcompris_db_set_version(gchar *version);
void gcompris_db_board_update(gint *board_id,
gint *section_id,
gchar *name,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment