gcompris r3610 - in branches/gcomprixogoo/src: boards gcompris goocanvas/src



Author: bcoudoin
Date: Mon Nov 10 00:42:57 2008
New Revision: 3610
URL: http://svn.gnome.org/viewvc/gcompris?rev=3610&view=rev

Log:
svn cleanup and fix bar unref
replaced non important warnings by messages to easy debuging


Modified:
   branches/gcomprixogoo/src/boards/python.c
   branches/gcomprixogoo/src/gcompris/gcompris_db.c
   branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c
   branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.h

Modified: branches/gcomprixogoo/src/boards/python.c
==============================================================================
--- branches/gcomprixogoo/src/boards/python.c	(original)
+++ branches/gcomprixogoo/src/boards/python.c	Mon Nov 10 00:42:57 2008
@@ -179,7 +179,7 @@
     execstr = g_strdup_printf("import sys; sys.path.append('%s')",properties->package_python_plugin_dir );
 #endif
 
-    g_warning("Executing %s\n", execstr);
+    g_message("Executing %s\n", execstr);
     if(PyRun_SimpleString(execstr)!=0){
       pythonboard_is_ready = FALSE;
       g_warning("! Python disabled: Cannot add plugins dir into search path\n");
@@ -221,7 +221,7 @@
 
 	    /* Test if board come with --python_plugin_dir option */
 
-	    g_warning("board_dir: '%s' python_plugin_dir '%s' file_name '%s'",
+	    g_message("board_dir: '%s' python_plugin_dir '%s' file_name '%s'",
 		      board->board_dir,
 		      properties->package_python_plugin_dir,
 		      board_file_name);
@@ -241,7 +241,7 @@
 
 	      if (PyObject_HasAttrString( py_boardclass, "config_start")) {
 		config_boards = g_list_append(config_boards, board);
-		g_warning("The board '%s' has a configuration entry",
+		g_message("The board '%s' has a configuration entry",
 			  board_file_name);
 	      }
 	    }

Modified: branches/gcomprixogoo/src/gcompris/gcompris_db.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/gcompris_db.c	(original)
+++ branches/gcomprixogoo/src/gcompris/gcompris_db.c	Mon Nov 10 00:42:57 2008
@@ -157,19 +157,19 @@
     /* if size of file is null, we recreate the tables */
     if (buf.st_size == 0){
       creation = TRUE;
-      g_warning("Database file is empty! Trying to create table...");
+      g_message("Database file is empty! Trying to create table...");
     }
   }
 #endif
 
   rc = sqlite3_open(properties->database, &gcompris_db);
   if( rc ){
-    g_warning("Can't open database %s : %s\n", properties->database, sqlite3_errmsg(gcompris_db));
+    g_message("Can't open database %s : %s\n", properties->database, sqlite3_errmsg(gcompris_db));
     sqlite3_close(gcompris_db);
     exit(1);
   }
 
-  g_warning("Database %s opened", properties->database);
+  g_message("Database %s opened", properties->database);
 
   if (creation){
     /* create all tables needed */
@@ -244,7 +244,7 @@
       g_error("SQL error: %s\n", zErrMsg);
     }
 
-    g_warning("Database tables created");
+    g_message("Database tables created");
 
     request = g_strdup_printf(SET_VERSION(VERSION));
 
@@ -305,7 +305,7 @@
     if (!(strcmp(result[1],"ok")==0))
       g_error("DATABASE integrity check returns %s \n", result[1]);
 
-    g_warning("Database Integrity ok");
+    g_message("Database Integrity ok");
     sqlite3_free_table(result);
 
     rc = sqlite3_get_table(gcompris_db,
@@ -320,7 +320,7 @@
     }
 
     if (strcmp(result[1],VERSION)!=0)
-      g_warning("Running GCompris is %s, but database version is %s", VERSION, result[1]);
+      g_message("Running GCompris is %s, but database version is %s", VERSION, result[1]);
     sqlite3_free_table(result);
 
     /* Schema upgrade */
@@ -339,7 +339,7 @@
     sqlite3_free_table(result);
     if(version <= 16)
       {
-	g_warning("Upgrading from <16 schema version\n");
+	g_message("Upgrading from <16 schema version\n");
 	rc = sqlite3_exec(gcompris_db,CREATE_TABLE_LOGS, NULL,  0, &zErrMsg);
 	if( rc!=SQLITE_OK ) {
 	  g_error("SQL error: %s\n", zErrMsg);
@@ -359,7 +359,7 @@
 
 #ifdef USE_SQLITE
   sqlite3_close(gcompris_db);
-  g_warning("Database closed");
+  g_message("Database closed");
   return TRUE;
 #endif
 }
@@ -934,7 +934,7 @@
     g_free(request);
 
     if (nrow == 0){
-      g_warning("No users' groups for profile %s", profile->name);
+      g_message("No users' groups for profile %s", profile->name);
       profile->group_ids = NULL;
     } else {
       ids = NULL;
@@ -966,7 +966,7 @@
     g_free(request);
 
     if (nrow == 0){
-      g_warning("No activities for profile %s", profile->name);
+      g_message("No activities for profile %s", profile->name);
       profile->activities = NULL;
     } else {
       ids = NULL;
@@ -1111,7 +1111,7 @@
   g_free(request);
 
   if (nrow == 0){
-    g_warning("No users in the group id %d", group_id);
+    g_message("No users in the group id %d", group_id);
   } else {
     i = ncolumn;
     while (i < (nrow +1)*ncolumn) {
@@ -1167,7 +1167,7 @@
   g_free(request);
 
   if (nrow == 0){
-    g_warning("No user with id  %d", user_id);
+    g_message("No user with id  %d", user_id);
     return NULL;
   } else {
     i = ncolumn;
@@ -1223,7 +1223,7 @@
   g_free(request);
 
   if (nrow == 0){
-    g_warning("No class with id %d", class_id);
+    g_message("No class with id %d", class_id);
     return NULL;
     return NULL;
   } else {
@@ -1392,7 +1392,7 @@
   request = g_strdup_printf(GET_CONF(profile_id,
 				     board_id));
 
-  g_warning ( "Request get_conf : %s", request);
+  g_message ( "Request get_conf : %s", request);
 
   rc = sqlite3_get_table(gcompris_db,
 			 request,
@@ -1414,7 +1414,7 @@
       g_hash_table_replace (hash_conf,
 			    g_strdup(result[i]),
 			    g_strdup(result[i+1]));
-      g_warning("get_conf: put key %s value %s in the hash",
+      g_message("get_conf: put key %s value %s in the hash",
 		result[i],
 		result[i+1]);
     }
@@ -1534,7 +1534,7 @@
     g_free(request);
 
     if (nrow_ == 0){
-      g_warning("No users groups for profile %s", profile->name);
+      g_message("No users groups for profile %s", profile->name);
       profile->group_ids = NULL;
     } else {
       ids_ = NULL;
@@ -1567,7 +1567,7 @@
     g_free(request);
 
     if (nrow_ == 0){
-      g_warning("No activities out for profile %s", profile->name);
+      g_message("No activities out for profile %s", profile->name);
       profile->activities = NULL;
     } else {
       ids_ = NULL;
@@ -1627,7 +1627,7 @@
   g_free(request);
 
   if (nrow == 0){
-    g_warning("No group with id  %d", group_id);
+    g_message("No group with id  %d", group_id);
     return NULL;
   } else {
     i = ncolumn;
@@ -1678,7 +1678,7 @@
   }
 
   if (nrow == 0){
-    g_warning("No groups !");
+    g_message("No groups !");
     return NULL;
   } else {
     i = ncolumn;
@@ -1813,7 +1813,7 @@
   }
 
   if (nrow == 0){
-    g_warning("No users !");
+    g_message("No users !");
     return NULL;
   } else {
     i = ncolumn;
@@ -1867,7 +1867,7 @@
   }
 
   if (nrow == 0){
-    g_warning("No groups !");
+    g_message("No groups !");
     return NULL;
   } else {
     i = ncolumn;

Modified: branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c
==============================================================================
--- branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c	(original)
+++ branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.c	Mon Nov 10 00:42:57 2008
@@ -46,10 +46,11 @@
 
 }
 
-static void _init_surface(GooCanvasSvg *canvas_svg)
+static void _init_surface(GooCanvasSvg *canvas_svg,
+			  RsvgHandle *svg_handle)
 {
   RsvgDimensionData dimension_data;
-  rsvg_handle_get_dimensions (canvas_svg->svg_handle, &dimension_data);
+  rsvg_handle_get_dimensions (svg_handle, &dimension_data);
   canvas_svg->width = dimension_data.width;
   canvas_svg->height = dimension_data.height;
 
@@ -66,7 +67,7 @@
 				canvas_svg->width,
 				canvas_svg->height);
   canvas_svg->cr = cairo_create (cst);
-  rsvg_handle_render_cairo (canvas_svg->svg_handle, canvas_svg->cr);
+  rsvg_handle_render_cairo (svg_handle, canvas_svg->cr);
   canvas_svg->pattern = cairo_pattern_create_for_surface (cst);
   cairo_surface_destroy(cst);
 }
@@ -100,9 +101,8 @@
   item = g_object_new (GOO_TYPE_CANVAS_SVG, NULL);
 
   canvas_svg = (GooCanvasSvg*) item;
-  canvas_svg->svg_handle = svg_handle;
   if(svg_handle)
-      _init_surface(canvas_svg);
+    _init_surface(canvas_svg, svg_handle);
 
   va_start (var_args, svg_handle);
   first_property = va_arg (var_args, char*);
@@ -147,12 +147,11 @@
 {
   GooCanvasSvg *canvas_svg = (GooCanvasSvg*) simple;
 
-  if(canvas_svg->svg_handle)
+  if(canvas_svg->pattern)
     {
       cairo_set_source (cr, canvas_svg->pattern);
       cairo_paint (cr);
     }
-  //rsvg_handle_render_cairo_sub (canvas_svg->svg_handle, cr, canvas_svg->id);
 }
 
 
@@ -161,11 +160,6 @@
 {
   GooCanvasSvg *canvas_svg = (GooCanvasSvg*) object;
 
-  /* Free our data if we didn't have a model. */
-  if(canvas_svg->svg_handle)
-    g_object_unref (canvas_svg->svg_handle);
-  canvas_svg->svg_handle = NULL;
-
   if (canvas_svg->id)
     g_free(canvas_svg->id);
   canvas_svg->id = NULL;
@@ -196,8 +190,7 @@
     {
     case PROP_SVGHANDLE:
       svg_handle = g_value_get_object (value);
-      canvas_svg->svg_handle = svg_handle;
-      _init_surface(canvas_svg);
+      _init_surface(canvas_svg, svg_handle);
       break;
     case PROP_SVG_ID:
       if (!g_value_get_string (value))

Modified: branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.h
==============================================================================
--- branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.h	(original)
+++ branches/gcomprixogoo/src/goocanvas/src/goocanvassvg.h	Mon Nov 10 00:42:57 2008
@@ -7,10 +7,10 @@
 #ifndef __GOO_CANVAS_SVG_H__
 #define __GOO_CANVAS_SVG_H__
 
-#include <librsvg/rsvg.h>
-#include <librsvg/rsvg-cairo.h>
 #include <gtk/gtk.h>
 #include "goocanvasitemsimple.h"
+#include <librsvg/rsvg.h>
+#include <librsvg/rsvg-cairo.h>
 
 G_BEGIN_DECLS
 
@@ -30,7 +30,6 @@
 {
   GooCanvasItemSimple parent_object;
 
-  RsvgHandle *svg_handle;
   gdouble width, height;
   gchar *id;
   cairo_t *cr;



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