r1083 - in packages/trunk/teg/debian: . patches

Gonéri Le Bouder goneri-guest at costa.debian.org
Sun Jul 16 21:35:45 UTC 2006


Author: goneri-guest
Date: 2006-07-16 21:35:44 +0000 (Sun, 16 Jul 2006)
New Revision: 1083

Added:
   packages/trunk/teg/debian/patches/20_avoid_invalid_theme.patch
Modified:
   packages/trunk/teg/debian/changelog
Log:
  * 20_avoid_invalid_theme.patch to avoid problem is the theme defined
    in gconf doesn't exist (Closes: # 281164)


Modified: packages/trunk/teg/debian/changelog
===================================================================
--- packages/trunk/teg/debian/changelog	2006-07-16 21:18:45 UTC (rev 1082)
+++ packages/trunk/teg/debian/changelog	2006-07-16 21:35:44 UTC (rev 1083)
@@ -1,3 +1,10 @@
+teg (0.11.1-4) UNRELEASED; urgency=low
+
+  * 20_avoid_invalid_theme.patch to avoid problem is the theme defined
+    in gconf doesn't exist (Closes: # 281164)
+
+ -- Gonéri Le Bouder <goneri at rulezlan.org>  Sun, 16 Jul 2006 23:35:20 +0200
+
 teg (0.11.1-3) unstable; urgency=high
 
   [ Gonéri Le Bouder ]

Added: packages/trunk/teg/debian/patches/20_avoid_invalid_theme.patch
===================================================================
--- packages/trunk/teg/debian/patches/20_avoid_invalid_theme.patch	2006-07-16 21:18:45 UTC (rev 1082)
+++ packages/trunk/teg/debian/patches/20_avoid_invalid_theme.patch	2006-07-16 21:35:44 UTC (rev 1083)
@@ -0,0 +1,44 @@
+diff -ru teg-0.11.1.orig/client/gui-gnome/gui.c teg-0.11.1/client/gui-gnome/gui.c
+--- teg-0.11.1.orig/client/gui-gnome/gui.c	2002-10-14 23:04:36.000000000 +0200
++++ teg-0.11.1/client/gui-gnome/gui.c	2006-07-16 23:33:51.000000000 +0200
+@@ -49,7 +49,7 @@
+ #include "g_scores.h"
+ #include "locate_country.h"
+ 
+-
++#include "../themes.h"
+ struct _gui_private gui_private;
+ 
+ TTheme	gui_theme;
+@@ -274,12 +274,25 @@
+ 	gui_private.status_show =  gconf_client_get_int( g_conf_client, "/apps/teg/status_show",NULL);
+ 	gui_private.dialog_show =  gconf_client_get_int( g_conf_client, "/apps/teg/dialog_show",NULL);
+ 	string = gconf_client_get_string( g_conf_client, "/apps/teg/theme",NULL);
+-	if( string )
+-		strncpy( g_game.theme, string ,sizeof(g_game.theme) );
+-	else
+-		strncpy( g_game.theme, "m2" ,sizeof(g_game.theme) );
+-	g_game.robot_in_server = gconf_client_get_bool( g_conf_client, "/apps/teg/robot_in_server",NULL);
+-	
++
++  int theme_exists = 0;
++  if( string ) {
++    pTInfo pInext, g_tinfo;
++    theme_enum_themes(g_tinfo);
++
++    for(pInext=g_tinfo;pInext;pInext = pInext->next ) {
++      if( strncmp(pInext->name,string,strlen(pInext->name)) == 0 ) {
++        theme_exists = 1;
++        break;
++        }
++      }
++  }
++  if (theme_exists)
++    strncpy( g_game.theme, string ,sizeof(g_game.theme) );
++  else
++    strncpy( g_game.theme, "m2" ,sizeof(g_game.theme) );
++  g_game.robot_in_server = gconf_client_get_bool( g_conf_client, "/apps/teg/robot_in_server",NULL);
++
+ 	gconf_client_set_int   ( g_conf_client, "/apps/teg/port",  g_game.serport, NULL);
+ 	gconf_client_set_string( g_conf_client, "/apps/teg/servername",g_game.sername, NULL);
+ 	gconf_client_set_string( g_conf_client, "/apps/teg/playername",g_game.myname, NULL);




More information about the Pkg-games-commits mailing list