Merge lp:~ecx69/bellepoule/linux into lp:bellepoule

Proposed by betonniere
Status: Merged
Merged at revision: 249
Proposed branch: lp:~ecx69/bellepoule/linux
Merge into: lp:bellepoule
Diff against target: 1526 lines (+235/-214)
40 files modified
Makefile (+4/-3)
resources/glade/checkin.glade (+1/-1)
resources/glade/pool_supervisor.glade (+3/-3)
resources/glade/table.glade (+1/-1)
sources/attribute.cpp (+26/-23)
sources/attribute.hpp (+17/-17)
sources/canvas.cpp (+5/-5)
sources/canvas.hpp (+5/-5)
sources/canvas_module.cpp (+2/-2)
sources/canvas_module.hpp (+2/-2)
sources/checkin.cpp (+17/-17)
sources/checkin.hpp (+1/-1)
sources/classification.cpp (+3/-3)
sources/classification.hpp (+3/-3)
sources/contest.cpp (+13/-13)
sources/contest.hpp (+10/-10)
sources/data.cpp (+7/-6)
sources/data.hpp (+4/-4)
sources/filter.cpp (+2/-2)
sources/filter.hpp (+2/-2)
sources/general_classification.cpp (+3/-2)
sources/glade.cpp (+8/-4)
sources/glade.hpp (+4/-4)
sources/main.cpp (+1/-0)
sources/module.cpp (+5/-3)
sources/module.hpp (+5/-5)
sources/object.cpp (+18/-13)
sources/object.hpp (+6/-6)
sources/player.cpp (+5/-5)
sources/player.hpp (+7/-7)
sources/players_list.cpp (+4/-4)
sources/players_list.hpp (+4/-4)
sources/pool.cpp (+15/-15)
sources/pool.hpp (+5/-5)
sources/pool_allocator.cpp (+3/-2)
sources/score_collector.cpp (+2/-2)
sources/score_collector.hpp (+2/-2)
sources/stage.hpp (+1/-1)
sources/table.cpp (+7/-5)
sources/table.hpp (+2/-2)
To merge this branch: bzr merge lp:~ecx69/bellepoule/linux
Reviewer Review Type Date Requested Status
betonniere Approve
Review via email: mp+47016@code.launchpad.net
To post a comment you must log in.
Revision history for this message
betonniere (betonniere) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2010-05-13 17:56:58 +0000
+++ Makefile 2011-01-21 08:07:55 +0000
@@ -11,11 +11,12 @@
1111
12# Options de compilation, l'option -Wno-write-strings est utilisé car beaucoup de warnings12# Options de compilation, l'option -Wno-write-strings est utilisé car beaucoup de warnings
13# sur la conversion de chaines constantes en *gchar13# sur la conversion de chaines constantes en *gchar
14OPTS=-Wall -Wno-write-strings14#OPTS=-Wall -Wno-write-strings -Werror -pedantic-errors
15OPTS=-Wall -std=c++98 -pedantic
15OPTSDBG=$(OPTS) -g16OPTSDBG=$(OPTS) -g
1617
17# Fichiers source à compiler et à linker, ATTENTION à mettre à jour la liste à chaque nouvelle version18# Fichiers source à compiler et à linker, ATTENTION à mettre à jour la liste à chaque nouvelle version
18SRCS=attribute.cpp canvas.cpp canvas_module.cpp checkin.cpp classification.cpp contest.cpp data.cpp filter.cpp general_classification.cpp glade.cpp main.cpp match.cpp module.cpp object.cpp player.cpp players_list.cpp pool_allocator.cpp pool.cpp pool_match_order.cpp pool_supervisor.cpp schedule.cpp score_collector.cpp score.cpp sensitivity_trigger.cpp splitting.cpp stage.cpp table.cpp tournament.cpp19SRCS=attendees.cpp attribute.cpp canvas.cpp canvas_module.cpp checkin.cpp classification.cpp contest.cpp data.cpp filter.cpp general_classification.cpp glade.cpp main.cpp match.cpp module.cpp object.cpp player.cpp players_list.cpp pool_allocator.cpp pool.cpp pool_match_order.cpp pool_supervisor.cpp schedule.cpp score_collector.cpp score.cpp sensitivity_trigger.cpp splitting.cpp stage.cpp swapper.cpp table.cpp tournament.cpp
19OBJS=$(SRCS:.cpp=.o)20OBJS=$(SRCS:.cpp=.o)
2021
21# Nom du fichier exécutable à générer dans $(DBGDIR) et $(RLSDIR)22# Nom du fichier exécutable à générer dans $(DBGDIR) et $(RLSDIR)
@@ -29,7 +30,7 @@
2930
30%.o: $(SRCDIR)/%.cpp31%.o: $(SRCDIR)/%.cpp
31 @mkdir -p $(OBJDIR)32 @mkdir -p $(OBJDIR)
32 @$(CC) -c $< -o $(OBJDIR)/$@ $(CFLAGS) $(OPTS)33 @$(CC) -c $< -o $(OBJDIR)/$@ $(CFLAGS) $(OPTSDBG)
3334
34.PHONY: clean35.PHONY: clean
35clean:36clean:
3637
=== modified file 'resources/glade/checkin.glade'
--- resources/glade/checkin.glade 2010-10-04 20:12:34 +0000
+++ resources/glade/checkin.glade 2011-01-21 08:07:55 +0000
@@ -274,7 +274,7 @@
274 <property name="visible">True</property>274 <property name="visible">True</property>
275 <property name="spacing">2</property>275 <property name="spacing">2</property>
276 <child>276 <child>
277 <object class="GtkHBox" id="hbox2">277 <object class="GtkHBox" id="hbox4">
278 <property name="visible">True</property>278 <property name="visible">True</property>
279 <child>279 <child>
280 <object class="GtkVBox" id="check_vbox">280 <object class="GtkVBox" id="check_vbox">
281281
=== modified file 'resources/glade/pool_supervisor.glade'
--- resources/glade/pool_supervisor.glade 2010-12-19 17:35:40 +0000
+++ resources/glade/pool_supervisor.glade 2011-01-21 08:07:55 +0000
@@ -318,7 +318,7 @@
318 <property name="label_xalign">0</property>318 <property name="label_xalign">0</property>
319 <property name="shadow_type">none</property>319 <property name="shadow_type">none</property>
320 <child>320 <child>
321 <object class="GtkAspectFrame" id="aspectframe1">321 <object class="GtkAspectFrame" id="aspectframe3">
322 <property name="visible">True</property>322 <property name="visible">True</property>
323 <property name="label_xalign">0</property>323 <property name="label_xalign">0</property>
324 <property name="shadow_type">none</property>324 <property name="shadow_type">none</property>
@@ -358,7 +358,7 @@
358 </object>358 </object>
359 </child>359 </child>
360 <child type="label">360 <child type="label">
361 <object class="GtkLabel" id="label2">361 <object class="GtkLabel" id="label3">
362 <property name="visible">True</property>362 <property name="visible">True</property>
363 <property name="label" translatable="yes">&lt;b&gt;What?&lt;/b&gt;</property>363 <property name="label" translatable="yes">&lt;b&gt;What?&lt;/b&gt;</property>
364 <property name="use_markup">True</property>364 <property name="use_markup">True</property>
@@ -417,7 +417,7 @@
417 </object>417 </object>
418 </child>418 </child>
419 <child type="label">419 <child type="label">
420 <object class="GtkLabel" id="label1">420 <object class="GtkLabel" id="label5">
421 <property name="visible">True</property>421 <property name="visible">True</property>
422 <property name="label" translatable="yes">&lt;b&gt;For what?&lt;/b&gt;</property>422 <property name="label" translatable="yes">&lt;b&gt;For what?&lt;/b&gt;</property>
423 <property name="use_markup">True</property>423 <property name="use_markup">True</property>
424424
=== modified file 'resources/glade/table.glade'
--- resources/glade/table.glade 2010-12-19 17:35:40 +0000
+++ resources/glade/table.glade 2011-01-21 08:07:55 +0000
@@ -530,7 +530,7 @@
530 <property name="orientation">vertical</property>530 <property name="orientation">vertical</property>
531 <property name="spacing">2</property>531 <property name="spacing">2</property>
532 <child>532 <child>
533 <object class="GtkAspectFrame" id="aspectframe1">533 <object class="GtkAspectFrame" id="aspectframe4">
534 <property name="visible">True</property>534 <property name="visible">True</property>
535 <property name="label_xalign">0</property>535 <property name="label_xalign">0</property>
536 <property name="shadow_type">none</property>536 <property name="shadow_type">none</property>
537537
=== modified file 'sources/attribute.cpp'
--- sources/attribute.cpp 2010-12-13 21:03:47 +0000
+++ sources/attribute.cpp 2011-01-21 08:07:55 +0000
@@ -23,7 +23,7 @@
23GSList *AttributeDesc::_list = NULL;23GSList *AttributeDesc::_list = NULL;
2424
25// --------------------------------------------------------------------------------25// --------------------------------------------------------------------------------
26static gchar *GetUndivadableText (gchar *text)26static gchar *GetUndivadableText (const gchar *text)
27{27{
28 gchar *result = NULL;28 gchar *result = NULL;
2929
@@ -31,7 +31,7 @@
31 {31 {
32 guint nb_space = 0;32 guint nb_space = 0;
3333
34 for (gchar *current = text; *current != 0; current++)34 for (gchar *current = (gchar *) text; *current != 0; current++)
35 {35 {
36 if (*current == ' ')36 if (*current == ' ')
37 {37 {
@@ -67,16 +67,16 @@
67}67}
6868
69// --------------------------------------------------------------------------------69// --------------------------------------------------------------------------------
70AttributeDesc::AttributeDesc (GType type,70AttributeDesc::AttributeDesc (GType type,
71 gchar *code_name,71 const gchar *code_name,
72 gchar *xml_name,72 const gchar *xml_name,
73 gchar *user_name)73 const gchar *user_name)
74: Object ("AttributeDesc")74: Object ("AttributeDesc")
75{75{
76 _type = type;76 _type = type;
77 _code_name = code_name;77 _code_name = g_strdup (code_name);
78 _xml_name = xml_name;78 _xml_name = g_strdup (xml_name);
79 _user_name = user_name;79 _user_name = g_strdup (user_name);
80 _uniqueness = SINGULAR;80 _uniqueness = SINGULAR;
81 _persistency = PERSISTENT;81 _persistency = PERSISTENT;
82 _scope = GLOBAL;82 _scope = GLOBAL;
@@ -98,6 +98,9 @@
98 {98 {
99 g_object_unref (_discrete_store);99 g_object_unref (_discrete_store);
100 }100 }
101 g_free (_code_name);
102 g_free (_xml_name);
103 g_free (_user_name);
101}104}
102105
103// --------------------------------------------------------------------------------106// --------------------------------------------------------------------------------
@@ -107,10 +110,10 @@
107}110}
108111
109// --------------------------------------------------------------------------------112// --------------------------------------------------------------------------------
110AttributeDesc *AttributeDesc::Declare (GType type,113AttributeDesc *AttributeDesc::Declare (GType type,
111 gchar *code_name,114 const gchar *code_name,
112 gchar *xml_name,115 const gchar *xml_name,
113 gchar *user_name)116 gchar *user_name)
114{117{
115 AttributeDesc *attr_desc = new AttributeDesc (type,118 AttributeDesc *attr_desc = new AttributeDesc (type,
116 code_name,119 code_name,
@@ -271,9 +274,9 @@
271}274}
272275
273// --------------------------------------------------------------------------------276// --------------------------------------------------------------------------------
274void AttributeDesc::AddDiscreteValues (gchar *first_xml_image,277void AttributeDesc::AddDiscreteValues (const gchar *first_xml_image,
275 gchar *first_user_image,278 gchar *first_user_image,
276 gchar *first_icon,279 const gchar *first_icon,
277 ...)280 ...)
278{281{
279 if (_discrete_store == NULL)282 if (_discrete_store == NULL)
@@ -286,9 +289,9 @@
286289
287 {290 {
288 va_list ap;291 va_list ap;
289 gchar *xml_image = first_xml_image;292 gchar *xml_image = g_strdup (first_xml_image);
290 gchar *user_image = first_user_image;293 gchar *user_image = first_user_image;
291 gchar *icon = first_icon;294 gchar *icon = g_strdup (first_icon);
292295
293 va_start (ap, first_icon);296 va_start (ap, first_icon);
294 while (xml_image)297 while (xml_image)
@@ -324,7 +327,7 @@
324}327}
325328
326// --------------------------------------------------------------------------------329// --------------------------------------------------------------------------------
327void AttributeDesc::AddDiscreteValues (gchar *file)330void AttributeDesc::AddDiscreteValues (const gchar *file)
328{331{
329 if (_discrete_store == NULL)332 if (_discrete_store == NULL)
330 {333 {
@@ -434,7 +437,7 @@
434}437}
435438
436// --------------------------------------------------------------------------------439// --------------------------------------------------------------------------------
437AttributeDesc *AttributeDesc::GetDesc (gchar *name)440AttributeDesc *AttributeDesc::GetDesc (const gchar *name)
438{441{
439 for (guint i = 0; i < g_slist_length (_list); i++)442 for (guint i = 0; i < g_slist_length (_list); i++)
440 {443 {
@@ -554,7 +557,7 @@
554}557}
555558
556// --------------------------------------------------------------------------------559// --------------------------------------------------------------------------------
557void TextAttribute::SetValue (gchar *value)560void TextAttribute::SetValue (const gchar *value)
558{561{
559 if (value)562 if (value)
560 {563 {
@@ -648,7 +651,7 @@
648}651}
649652
650// --------------------------------------------------------------------------------653// --------------------------------------------------------------------------------
651void BooleanAttribute::SetValue (gchar *value)654void BooleanAttribute::SetValue (const gchar *value)
652{655{
653 if (value)656 if (value)
654 {657 {
@@ -726,7 +729,7 @@
726}729}
727730
728// --------------------------------------------------------------------------------731// --------------------------------------------------------------------------------
729void IntAttribute::SetValue (gchar *value)732void IntAttribute::SetValue (const gchar *value)
730{733{
731 if (value)734 if (value)
732 {735 {
733736
=== modified file 'sources/attribute.hpp'
--- sources/attribute.hpp 2010-12-13 21:03:47 +0000
+++ sources/attribute.hpp 2011-01-21 08:07:55 +0000
@@ -72,28 +72,28 @@
7272
73 static void SetPath (gchar *path);73 static void SetPath (gchar *path);
7474
75 static AttributeDesc *Declare (GType type,75 static AttributeDesc *Declare (GType type,
76 gchar *code_name,76 const gchar *code_name,
77 gchar *xml_name,77 const gchar *xml_name,
78 gchar *user_name);78 gchar *user_name);
7979
80 static void CreateList (GSList **list, ...);80 static void CreateList (GSList **list, ...);
8181
82 static GSList *GetList ();82 static GSList *GetList ();
8383
84 static AttributeDesc *GetDesc (gchar *name);84 static AttributeDesc *GetDesc (const gchar *name);
8585
86 void BindDiscreteValues (GObject *object,86 void BindDiscreteValues (GObject *object,
87 GtkCellRenderer *renderer = NULL);87 GtkCellRenderer *renderer = NULL);
8888
89 gboolean HasDiscreteValue ();89 gboolean HasDiscreteValue ();
9090
91 void AddDiscreteValues (gchar *first_xml_image,91 void AddDiscreteValues (const gchar *first_xml_image,
92 gchar *first_user_image,92 gchar *first_user_image,
93 gchar *first_icon,93 const gchar *first_icon,
94 ...);94 ...);
9595
96 void AddDiscreteValues (gchar *file);96 void AddDiscreteValues (const gchar *file);
9797
98 void *GetDiscreteValue (guint from_code);98 void *GetDiscreteValue (guint from_code);
9999
@@ -107,10 +107,10 @@
107 static gchar *_path;107 static gchar *_path;
108 static GSList *_list;108 static GSList *_list;
109109
110 AttributeDesc (GType type,110 AttributeDesc (GType type,
111 gchar *code_name,111 const gchar *code_name,
112 gchar *xml_name,112 const gchar *xml_name,
113 gchar *user_name);113 const gchar *user_name);
114114
115 ~AttributeDesc ();115 ~AttributeDesc ();
116};116};
@@ -132,7 +132,7 @@
132132
133 GType GetType ();133 GType GetType ();
134134
135 virtual void SetValue (gchar *value) = 0;135 virtual void SetValue (const gchar *value) = 0;
136136
137 virtual void SetValue (guint value) = 0;137 virtual void SetValue (guint value) = 0;
138138
@@ -170,7 +170,7 @@
170170
171 virtual ~TextAttribute ();171 virtual ~TextAttribute ();
172172
173 void SetValue (gchar *value);173 void SetValue (const gchar *value);
174174
175 void SetValue (guint value);175 void SetValue (guint value);
176176
@@ -201,7 +201,7 @@
201201
202 virtual ~BooleanAttribute ();202 virtual ~BooleanAttribute ();
203203
204 void SetValue (gchar *value);204 void SetValue (const gchar *value);
205205
206 void SetValue (guint value);206 void SetValue (guint value);
207207
@@ -231,7 +231,7 @@
231231
232 virtual ~IntAttribute ();232 virtual ~IntAttribute ();
233233
234 void SetValue (gchar *value);234 void SetValue (const gchar *value);
235235
236 void SetValue (guint value);236 void SetValue (guint value);
237237
238238
=== modified file 'sources/canvas.cpp'
--- sources/canvas.cpp 2010-12-13 21:03:47 +0000
+++ sources/canvas.cpp 2011-01-21 08:07:55 +0000
@@ -37,7 +37,7 @@
3737
38// --------------------------------------------------------------------------------38// --------------------------------------------------------------------------------
39void Canvas::SetTableItemAttribute (GooCanvasItem *item,39void Canvas::SetTableItemAttribute (GooCanvasItem *item,
40 gchar *attribute,40 const gchar *attribute,
41 gdouble value)41 gdouble value)
42{42{
43 GooCanvasItem *parent = goo_canvas_item_get_parent (item);43 GooCanvasItem *parent = goo_canvas_item_get_parent (item);
@@ -54,7 +54,7 @@
5454
55// --------------------------------------------------------------------------------55// --------------------------------------------------------------------------------
56void Canvas::SetTableItemAttribute (GooCanvasItem *item,56void Canvas::SetTableItemAttribute (GooCanvasItem *item,
57 gchar *attribute,57 const gchar *attribute,
58 guint value)58 guint value)
59{59{
60 GooCanvasItem *parent = goo_canvas_item_get_parent (item);60 GooCanvasItem *parent = goo_canvas_item_get_parent (item);
@@ -71,7 +71,7 @@
7171
72// --------------------------------------------------------------------------------72// --------------------------------------------------------------------------------
73GooCanvasItem *Canvas::PutTextInTable (GooCanvasItem *table,73GooCanvasItem *Canvas::PutTextInTable (GooCanvasItem *table,
74 gchar *text,74 const gchar *text,
75 guint row,75 guint row,
76 guint column)76 guint column)
77{77{
@@ -108,7 +108,7 @@
108108
109// --------------------------------------------------------------------------------109// --------------------------------------------------------------------------------
110GooCanvasItem *Canvas::CreateIcon (GooCanvasItem *parent,110GooCanvasItem *Canvas::CreateIcon (GooCanvasItem *parent,
111 gchar *icon_name,111 const gchar *icon_name,
112 gdouble x,112 gdouble x,
113 gdouble y)113 gdouble y)
114{114{
@@ -138,7 +138,7 @@
138138
139// --------------------------------------------------------------------------------139// --------------------------------------------------------------------------------
140GooCanvasItem *Canvas::PutStockIconInTable (GooCanvasItem *table,140GooCanvasItem *Canvas::PutStockIconInTable (GooCanvasItem *table,
141 gchar *icon_name,141 const gchar *icon_name,
142 guint row,142 guint row,
143 guint column)143 guint column)
144{144{
145145
=== modified file 'sources/canvas.hpp'
--- sources/canvas.hpp 2010-12-13 21:03:47 +0000
+++ sources/canvas.hpp 2011-01-21 08:07:55 +0000
@@ -31,12 +31,12 @@
31 guint column);31 guint column);
3232
33 static GooCanvasItem *PutTextInTable (GooCanvasItem *table,33 static GooCanvasItem *PutTextInTable (GooCanvasItem *table,
34 gchar *text,34 const gchar *text,
35 guint row,35 guint row,
36 guint column);36 guint column);
3737
38 static GooCanvasItem *CreateIcon (GooCanvasItem *parent,38 static GooCanvasItem *CreateIcon (GooCanvasItem *parent,
39 gchar *icon_name,39 const gchar *icon_name,
40 gdouble x,40 gdouble x,
41 gdouble y);41 gdouble y);
4242
@@ -46,16 +46,16 @@
46 guint column);46 guint column);
4747
48 static GooCanvasItem *PutStockIconInTable (GooCanvasItem *table,48 static GooCanvasItem *PutStockIconInTable (GooCanvasItem *table,
49 gchar *icon_name,49 const gchar *icon_name,
50 guint row,50 guint row,
51 guint column);51 guint column);
5252
53 static void SetTableItemAttribute (GooCanvasItem *item,53 static void SetTableItemAttribute (GooCanvasItem *item,
54 gchar *attribute,54 const gchar *attribute,
55 guint value);55 guint value);
5656
57 static void SetTableItemAttribute (GooCanvasItem *item,57 static void SetTableItemAttribute (GooCanvasItem *item,
58 gchar *attribute,58 const gchar *attribute,
59 gdouble value);59 gdouble value);
6060
61 static GooCanvas *CreatePrinterCanvas (GtkPrintContext *context);61 static GooCanvas *CreatePrinterCanvas (GtkPrintContext *context);
6262
=== modified file 'sources/canvas_module.cpp'
--- sources/canvas_module.cpp 2010-12-19 17:35:40 +0000
+++ sources/canvas_module.cpp 2011-01-21 08:07:55 +0000
@@ -25,8 +25,8 @@
25#include "canvas_module.hpp"25#include "canvas_module.hpp"
2626
27// --------------------------------------------------------------------------------27// --------------------------------------------------------------------------------
28CanvasModule::CanvasModule (gchar *glade_file,28CanvasModule::CanvasModule (const gchar *glade_file,
29 gchar *root)29 const gchar *root)
30: Module (glade_file,30: Module (glade_file,
31 root)31 root)
32{32{
3333
=== modified file 'sources/canvas_module.hpp'
--- sources/canvas_module.hpp 2010-05-17 12:24:43 +0000
+++ sources/canvas_module.hpp 2011-01-21 08:07:55 +0000
@@ -26,8 +26,8 @@
26class CanvasModule : public Module26class CanvasModule : public Module
27{27{
28 protected:28 protected:
29 CanvasModule (gchar *glade_file,29 CanvasModule (const gchar *glade_file,
30 gchar *root = NULL);30 const gchar *root = NULL);
31 virtual ~CanvasModule ();31 virtual ~CanvasModule ();
3232
33 static void WipeItem (GooCanvasItem *item);33 static void WipeItem (GooCanvasItem *item);
3434
=== modified file 'sources/checkin.cpp'
--- sources/checkin.cpp 2010-12-02 21:35:29 +0000
+++ sources/checkin.cpp 2011-01-21 08:07:55 +0000
@@ -264,7 +264,7 @@
264264
265// --------------------------------------------------------------------------------265// --------------------------------------------------------------------------------
266void Checkin::Load (xmlXPathContext *xml_context,266void Checkin::Load (xmlXPathContext *xml_context,
267 gchar *from_node)267 const gchar *from_node)
268{268{
269 gchar *path = g_strdup_printf ("%s/Tireurs", from_node);269 gchar *path = g_strdup_printf ("%s/Tireurs", from_node);
270 xmlXPathObject *xml_object = xmlXPathEval (BAD_CAST path, xml_context);270 xmlXPathObject *xml_object = xmlXPathEval (BAD_CAST path, xml_context);
@@ -778,24 +778,24 @@
778778
779 player = new Player;779 player = new Player;
780780
781 attr_id._name = "attending";781 attr_id._name = (gchar *) "attending";
782 player->SetAttributeValue (&attr_id, (guint) FALSE);782 player->SetAttributeValue (&attr_id, (guint) FALSE);
783783
784 if (tokens)784 if (tokens)
785 {785 {
786 attr_id._name = "name";786 attr_id._name = (gchar *) "name";
787 player->SetAttributeValue (&attr_id, tokens[0]);787 player->SetAttributeValue (&attr_id, tokens[0]);
788788
789 attr_id._name = "first_name";789 attr_id._name = (gchar *) "first_name";
790 player->SetAttributeValue (&attr_id, tokens[1]);790 player->SetAttributeValue (&attr_id, tokens[1]);
791791
792 attr_id._name = "birth_date";792 attr_id._name = (gchar *) "birth_date";
793 player->SetAttributeValue (&attr_id, tokens[2]);793 player->SetAttributeValue (&attr_id, tokens[2]);
794794
795 attr_id._name = "gender";795 attr_id._name = (gchar *) "gender";
796 player->SetAttributeValue (&attr_id, tokens[3]);796 player->SetAttributeValue (&attr_id, tokens[3]);
797797
798 attr_id._name = "country";798 attr_id._name = (gchar *) "country";
799 player->SetAttributeValue (&attr_id, tokens[4]);799 player->SetAttributeValue (&attr_id, tokens[4]);
800800
801 g_strfreev (tokens);801 g_strfreev (tokens);
@@ -815,7 +815,7 @@
815 0);815 0);
816 if (tokens)816 if (tokens)
817 {817 {
818 attr_id._name = "licence";818 attr_id._name = (gchar *) "licence";
819 player->SetAttributeValue (&attr_id, tokens[0]);819 player->SetAttributeValue (&attr_id, tokens[0]);
820820
821 if (strlen (tokens[0]) > 2)821 if (strlen (tokens[0]) > 2)
@@ -830,27 +830,27 @@
830830
831 if (league)831 if (league)
832 {832 {
833 attr_id._name = "league";833 attr_id._name = (gchar *) "league";
834 player->SetAttributeValue (&attr_id, league);834 player->SetAttributeValue (&attr_id, league);
835 g_free (league);835 g_free (league);
836 }836 }
837 }837 }
838 }838 }
839839
840 attr_id._name = "club";840 attr_id._name = (gchar *) "club";
841 player->SetAttributeValue (&attr_id, tokens[2]);841 player->SetAttributeValue (&attr_id, tokens[2]);
842842
843 attr_id._name = "exported";843 attr_id._name = (gchar *) "exported";
844 player->SetAttributeValue (&attr_id, (guint) FALSE);844 player->SetAttributeValue (&attr_id, (guint) FALSE);
845845
846 if (tokens[3] == NULL)846 if (tokens[3] == NULL)
847 {847 {
848 attr_id._name = "rating";848 attr_id._name = (gchar *) "rating";
849 player->SetAttributeValue (&attr_id, (guint) 0);849 player->SetAttributeValue (&attr_id, (guint) 0);
850 }850 }
851 else851 else
852 {852 {
853 attr_id._name = "rating";853 attr_id._name = (gchar *) "rating";
854 player->SetAttributeValue (&attr_id, tokens[3]);854 player->SetAttributeValue (&attr_id, tokens[3]);
855 }855 }
856856
@@ -922,16 +922,16 @@
922 Player *player = new Player;922 Player *player = new Player;
923 Player::AttributeId attr_id ("");923 Player::AttributeId attr_id ("");
924924
925 attr_id._name = "attending";925 attr_id._name = (gchar *) "attending";
926 player->SetAttributeValue (&attr_id, (guint) FALSE);926 player->SetAttributeValue (&attr_id, (guint) FALSE);
927927
928 attr_id._name = "name";928 attr_id._name = (gchar *) "name";
929 player->SetAttributeValue (&attr_id, tokens[i]);929 player->SetAttributeValue (&attr_id, tokens[i]);
930930
931 attr_id._name = "first_name";931 attr_id._name = (gchar *) "first_name";
932 player->SetAttributeValue (&attr_id, tokens[i+1]);932 player->SetAttributeValue (&attr_id, tokens[i+1]);
933933
934 attr_id._name = "exported";934 attr_id._name = (gchar *) "exported";
935 player->SetAttributeValue (&attr_id, (guint) FALSE);935 player->SetAttributeValue (&attr_id, (guint) FALSE);
936936
937937
938938
=== modified file 'sources/checkin.hpp'
--- sources/checkin.hpp 2010-11-03 12:00:16 +0000
+++ sources/checkin.hpp 2011-01-21 08:07:55 +0000
@@ -72,7 +72,7 @@
72 void Load (xmlNode *xml_node);72 void Load (xmlNode *xml_node);
7373
74 void Load (xmlXPathContext *xml_context,74 void Load (xmlXPathContext *xml_context,
75 gchar *from_node);75 const gchar *from_node);
7676
77 void Save (xmlTextWriter *xml_writer);77 void Save (xmlTextWriter *xml_writer);
7878
7979
=== modified file 'sources/classification.cpp'
--- sources/classification.cpp 2010-12-09 21:33:26 +0000
+++ sources/classification.cpp 2011-01-21 08:07:55 +0000
@@ -245,9 +245,9 @@
245}245}
246246
247// --------------------------------------------------------------------------------247// --------------------------------------------------------------------------------
248void Classification::WriteFFFString (FILE *file,248void Classification::WriteFFFString (FILE *file,
249 Player *player,249 Player *player,
250 gchar *attr_name)250 const gchar *attr_name)
251{251{
252 Player::AttributeId attr_id (attr_name);252 Player::AttributeId attr_id (attr_name);
253 Attribute *attr = player->GetAttribute (&attr_id);253 Attribute *attr = player->GetAttribute (&attr_id);
254254
=== modified file 'sources/classification.hpp'
--- sources/classification.hpp 2010-11-30 22:28:25 +0000
+++ sources/classification.hpp 2011-01-21 08:07:55 +0000
@@ -43,9 +43,9 @@
43 private:43 private:
44 void OnPlugged ();44 void OnPlugged ();
4545
46 void WriteFFFString (FILE *file,46 void WriteFFFString (FILE *file,
47 Player *player,47 Player *player,
48 gchar *attr_name);48 const gchar *attr_name);
4949
50 ~Classification ();50 ~Classification ();
51};51};
5252
=== modified file 'sources/contest.cpp'
--- sources/contest.cpp 2010-12-29 20:11:22 +0000
+++ sources/contest.cpp 2011-01-21 08:07:55 +0000
@@ -35,35 +35,35 @@
3535
36#include "contest.hpp"36#include "contest.hpp"
3737
38gchar *Contest::weapon_image[_nb_weapon] =38const gchar *Contest::weapon_image[_nb_weapon] =
39{39{
40 N_ ("Sabre"),40 N_ ("Sabre"),
41 N_ ("Epée"),41 N_ ("Epée"),
42 N_ ("Foil")42 N_ ("Foil")
43};43};
4444
45gchar *Contest::weapon_xml_image[_nb_weapon] =45const gchar *Contest::weapon_xml_image[_nb_weapon] =
46{46{
47 "S",47 "S",
48 "E",48 "E",
49 "F"49 "F"
50};50};
5151
52gchar *Contest::gender_image[_nb_gender] =52const gchar *Contest::gender_image[_nb_gender] =
53{53{
54 N_ ("Male"),54 N_ ("Male"),
55 N_ ("Female"),55 N_ ("Female"),
56 N_ ("Mixed")56 N_ ("Mixed")
57};57};
5858
59gchar *Contest::gender_xml_image[_nb_gender] =59const gchar *Contest::gender_xml_image[_nb_gender] =
60{60{
61 "M",61 "M",
62 "F",62 "F",
63 "FM"63 "FM"
64};64};
6565
66gchar *Contest::category_image[_nb_category] =66const gchar *Contest::category_image[_nb_category] =
67{67{
68 N_ ("U8"),68 N_ ("U8"),
69 N_ ("U10"),69 N_ ("U10"),
@@ -75,7 +75,7 @@
75 N_ ("Veteran")75 N_ ("Veteran")
76};76};
7777
78gchar *Contest::category_xml_image[_nb_category] =78const gchar *Contest::category_xml_image[_nb_category] =
79{79{
80 "O",80 "O",
81 "P",81 "P",
@@ -90,9 +90,9 @@
90GList *Contest::_color_list = NULL;90GList *Contest::_color_list = NULL;
9191
92// --------------------------------------------------------------------------------92// --------------------------------------------------------------------------------
93Contest::Time::Time (gchar *name)93Contest::Time::Time (const gchar *name)
94{94{
95 _name = name;95 _name = g_strdup (name);
96 _hour = 12;96 _hour = 12;
97 _minute = 0;97 _minute = 0;
98}98}
@@ -104,12 +104,12 @@
104104
105// --------------------------------------------------------------------------------105// --------------------------------------------------------------------------------
106void Contest::Time::Save (xmlTextWriter *xml_writer,106void Contest::Time::Save (xmlTextWriter *xml_writer,
107 gchar *attr_name)107 const gchar *attr_name)
108{108{
109 xmlTextWriterWriteFormatAttribute (xml_writer,109 xmlTextWriterWriteFormatAttribute (xml_writer,
110 BAD_CAST attr_name,110 BAD_CAST attr_name,
111 "%02d:%02d", _hour, _minute);111 "%02d:%02d", _hour, _minute);
112};112}
113113
114// --------------------------------------------------------------------------------114// --------------------------------------------------------------------------------
115void Contest::Time::Load (gchar *attr)115void Contest::Time::Load (gchar *attr)
@@ -971,8 +971,8 @@
971}971}
972972
973// --------------------------------------------------------------------------------973// --------------------------------------------------------------------------------
974gchar *Contest::GetSaveFileName (gchar *title,974gchar *Contest::GetSaveFileName (gchar *title,
975 gchar *config_key)975 const gchar *config_key)
976{976{
977 GtkWidget *chooser;977 GtkWidget *chooser;
978 char *filename = NULL;978 char *filename = NULL;
@@ -1291,7 +1291,7 @@
1291// --------------------------------------------------------------------------------1291// --------------------------------------------------------------------------------
1292gchar *Contest::GetGender ()1292gchar *Contest::GetGender ()
1293{1293{
1294 return gender_xml_image[_gender];1294 return (char *) gender_xml_image[_gender];
1295}1295}
12961296
1297// --------------------------------------------------------------------------------1297// --------------------------------------------------------------------------------
12981298
=== modified file 'sources/contest.hpp'
--- sources/contest.hpp 2010-11-30 22:28:25 +0000
+++ sources/contest.hpp 2011-01-21 08:07:55 +0000
@@ -64,13 +64,13 @@
64 private:64 private:
65 struct Time : public Object65 struct Time : public Object
66 {66 {
67 Time (gchar *name);67 Time (const gchar *name);
6868
69 ~Time ();69 ~Time ();
7070
71 void Load (gchar *attr);71 void Load (gchar *attr);
72 void Save (xmlTextWriter *xml_writer,72 void Save (xmlTextWriter *xml_writer,
73 gchar *attr_name);73 const gchar *attr_name);
74 void ReadProperties (Glade *glade);74 void ReadProperties (Glade *glade);
75 void FillInProperties (Glade *glade);75 void FillInProperties (Glade *glade);
76 void Copy (Time *to);76 void Copy (Time *to);
@@ -81,16 +81,16 @@
81 };81 };
8282
83 static const guint _nb_weapon = 3;83 static const guint _nb_weapon = 3;
84 static gchar *weapon_image[_nb_weapon];84 static const gchar *weapon_image[_nb_weapon];
85 static gchar *weapon_xml_image[_nb_weapon];85 static const gchar *weapon_xml_image[_nb_weapon];
8686
87 static const guint _nb_gender = 3;87 static const guint _nb_gender = 3;
88 static gchar *gender_image[_nb_gender];88 static const gchar *gender_image[_nb_gender];
89 static gchar *gender_xml_image[_nb_gender];89 static const gchar *gender_xml_image[_nb_gender];
9090
91 static const guint _nb_category = 8;91 static const guint _nb_category = 8;
92 static gchar *category_image[_nb_category];92 static const gchar *category_image[_nb_category];
93 static gchar *category_xml_image[_nb_category];93 static const gchar *category_xml_image[_nb_category];
9494
95 static GList *_color_list;95 static GList *_color_list;
9696
@@ -126,8 +126,8 @@
126 void InitInstance ();126 void InitInstance ();
127 void ReadProperties ();127 void ReadProperties ();
128 void DisplayProperties ();128 void DisplayProperties ();
129 gchar *GetSaveFileName (gchar *title,129 gchar *GetSaveFileName (gchar *title,
130 gchar *config_key);130 const gchar *config_key);
131 void Save (gchar *filename);131 void Save (gchar *filename);
132 void FillInProperties ();132 void FillInProperties ();
133 void FillInDate (guint day,133 void FillInDate (guint day,
134134
=== modified file 'sources/data.cpp'
--- sources/data.cpp 2010-07-10 20:17:09 +0000
+++ sources/data.cpp 2011-01-21 08:07:55 +0000
@@ -22,20 +22,20 @@
22#include "data.hpp"22#include "data.hpp"
2323
24// --------------------------------------------------------------------------------24// --------------------------------------------------------------------------------
25Data::Data (gchar *xml_name,25Data::Data (const gchar *xml_name,
26 guint default_value)26 guint default_value)
27{27{
28 _xml_name = xml_name;28 _xml_name = g_strdup (xml_name);
29 _value = default_value;29 _value = default_value;
3030
31 _is_integer = TRUE;31 _is_integer = TRUE;
32}32}
3333
34// --------------------------------------------------------------------------------34// --------------------------------------------------------------------------------
35Data::Data (gchar *xml_name,35Data::Data (const gchar *xml_name,
36 gchar *default_value)36 gchar *default_value)
37{37{
38 _xml_name = xml_name;38 _xml_name = g_strdup (xml_name);
39 _string = default_value;39 _string = default_value;
4040
41 _is_integer = FALSE;41 _is_integer = FALSE;
@@ -44,6 +44,7 @@
44// --------------------------------------------------------------------------------44// --------------------------------------------------------------------------------
45Data::~Data ()45Data::~Data ()
46{46{
47 g_free (_xml_name);
47}48}
4849
49// --------------------------------------------------------------------------------50// --------------------------------------------------------------------------------
5051
=== modified file 'sources/data.hpp'
--- sources/data.hpp 2010-07-10 20:17:09 +0000
+++ sources/data.hpp 2011-01-21 08:07:55 +0000
@@ -28,11 +28,11 @@
28 guint _value;28 guint _value;
29 gchar *_string;29 gchar *_string;
3030
31 Data (gchar *xml_name,31 Data (const gchar *xml_name,
32 guint default_value);32 guint default_value);
3333
34 Data (gchar *xml_name,34 Data (const gchar *xml_name,
35 gchar *default_value);35 gchar *default_value);
3636
37 void Save (xmlTextWriter *xml_writer);37 void Save (xmlTextWriter *xml_writer);
3838
3939
=== modified file 'sources/filter.cpp'
--- sources/filter.cpp 2010-10-07 11:38:36 +0000
+++ sources/filter.cpp 2011-01-21 08:07:55 +0000
@@ -81,7 +81,7 @@
81}81}
8282
83// --------------------------------------------------------------------------------83// --------------------------------------------------------------------------------
84guint Filter::GetAttributeId (gchar *name)84guint Filter::GetAttributeId (const gchar *name)
85{85{
86 if (_attr_list)86 if (_attr_list)
87 {87 {
@@ -118,7 +118,7 @@
118}118}
119119
120// --------------------------------------------------------------------------------120// --------------------------------------------------------------------------------
121void Filter::ShowAttribute (gchar *name)121void Filter::ShowAttribute (const gchar *name)
122{122{
123 GtkTreeIter iter;123 GtkTreeIter iter;
124 GtkTreeIter *sibling = NULL;124 GtkTreeIter *sibling = NULL;
125125
=== modified file 'sources/filter.hpp'
--- sources/filter.hpp 2010-06-25 21:16:12 +0000
+++ sources/filter.hpp 2011-01-21 08:07:55 +0000
@@ -31,7 +31,7 @@
3131
32 void SetAttributeList (GSList *list);32 void SetAttributeList (GSList *list);
3333
34 void ShowAttribute (gchar *name);34 void ShowAttribute (const gchar *name);
3535
36 void UpdateAttrList ();36 void UpdateAttrList ();
3737
@@ -41,7 +41,7 @@
4141
42 GSList *GetSelectedAttrList ();42 GSList *GetSelectedAttrList ();
4343
44 guint GetAttributeId (gchar *name);44 guint GetAttributeId (const gchar *name);
4545
46 void SetOwner (Module *owner);46 void SetOwner (Module *owner);
4747
4848
=== modified file 'sources/general_classification.cpp'
--- sources/general_classification.cpp 2010-12-29 07:36:17 +0000
+++ sources/general_classification.cpp 2011-01-21 08:07:55 +0000
@@ -265,11 +265,11 @@
265265
266 if (export_type == CSV)266 if (export_type == CSV)
267 {267 {
268 suffix = ".csv";268 suffix = g_strdup (".csv");
269 }269 }
270 else270 else
271 {271 {
272 suffix = ".fff";272 suffix = g_strdup (".fff");
273 }273 }
274274
275 {275 {
@@ -300,6 +300,7 @@
300 g_free (dirname);300 g_free (dirname);
301 }301 }
302 }302 }
303 g_free (suffix);
303 }304 }
304 }305 }
305306
306307
=== modified file 'sources/glade.cpp'
--- sources/glade.cpp 2010-09-05 20:04:10 +0000
+++ sources/glade.cpp 2011-01-21 08:07:55 +0000
@@ -19,8 +19,8 @@
19gchar *Glade::_path = NULL;19gchar *Glade::_path = NULL;
2020
21// --------------------------------------------------------------------------------21// --------------------------------------------------------------------------------
22Glade::Glade (gchar *file_name,22Glade::Glade (const gchar *file_name,
23 Object *owner)23 Object *owner)
24: Object ("Glade")24: Object ("Glade")
25{25{
26 if (file_name)26 if (file_name)
@@ -33,6 +33,10 @@
33 gtk_builder_add_from_file (_glade_xml,33 gtk_builder_add_from_file (_glade_xml,
34 path,34 path,
35 &error);35 &error);
36 if (error != NULL)
37 {
38 g_print ("<<%s>> %s\n", path, error->message);
39 }
36 g_free (path);40 g_free (path);
3741
38 if (error != NULL)42 if (error != NULL)
@@ -94,14 +98,14 @@
94}98}
9599
96// --------------------------------------------------------------------------------100// --------------------------------------------------------------------------------
97GtkWidget *Glade::GetWidget (gchar *name)101GtkWidget *Glade::GetWidget (const gchar *name)
98{102{
99 return (GtkWidget *) (gtk_builder_get_object (_glade_xml,103 return (GtkWidget *) (gtk_builder_get_object (_glade_xml,
100 name));104 name));
101}105}
102106
103// --------------------------------------------------------------------------------107// --------------------------------------------------------------------------------
104GObject *Glade::GetObject (gchar *name)108GObject *Glade::GetObject (const gchar *name)
105{109{
106 return gtk_builder_get_object (_glade_xml,110 return gtk_builder_get_object (_glade_xml,
107 name);111 name);
108112
=== modified file 'sources/glade.hpp'
--- sources/glade.hpp 2010-04-18 21:11:47 +0000
+++ sources/glade.hpp 2011-01-21 08:07:55 +0000
@@ -23,15 +23,15 @@
23class Glade : public Object23class Glade : public Object
24{24{
25 public:25 public:
26 Glade (gchar *file_name,26 Glade (const gchar *file_name,
27 Object *owner);27 Object *owner);
28 ~Glade ();28 ~Glade ();
2929
30 static void SetPath (gchar *path);30 static void SetPath (gchar *path);
3131
32 GtkWidget *GetRootWidget ();32 GtkWidget *GetRootWidget ();
33 GtkWidget *GetWidget (gchar *name);33 GtkWidget *GetWidget (const gchar *name);
34 GObject *GetObject (gchar *name);34 GObject *GetObject (const gchar *name);
35 void DetachFromParent (GtkWidget *widget);35 void DetachFromParent (GtkWidget *widget);
3636
37 private:37 private:
3838
=== modified file 'sources/main.cpp'
--- sources/main.cpp 2011-01-04 22:21:11 +0000
+++ sources/main.cpp 2011-01-21 08:07:55 +0000
@@ -40,6 +40,7 @@
40#include "attribute.hpp"40#include "attribute.hpp"
41#include "general_classification.hpp"41#include "general_classification.hpp"
42#include "glade.hpp"42#include "glade.hpp"
43#include "locale"
4344
44// --------------------------------------------------------------------------------45// --------------------------------------------------------------------------------
45static void AboutDialogActivateLinkFunc (GtkAboutDialog *about,46static void AboutDialogActivateLinkFunc (GtkAboutDialog *about,
4647
=== modified file 'sources/module.cpp'
--- sources/module.cpp 2010-12-13 21:03:47 +0000
+++ sources/module.cpp 2011-01-21 08:07:55 +0000
@@ -22,12 +22,14 @@
2222
23#include "module.hpp"23#include "module.hpp"
2424
25const gdouble Module::PRINT_HEADER_HEIGHT = 10.0; // % of paper width
26const gdouble Module::PRINT_FONT_HEIGHT = 2.0; // % of paper width
25GKeyFile *Module::_config_file = NULL;27GKeyFile *Module::_config_file = NULL;
26GtkTreeModel *Module::_status_model = NULL;28GtkTreeModel *Module::_status_model = NULL;
2729
28// --------------------------------------------------------------------------------30// --------------------------------------------------------------------------------
29Module::Module (gchar *glade_file,31Module::Module (const gchar *glade_file,
30 gchar *root)32 const gchar *root)
31//: Object ("Module")33//: Object ("Module")
32{34{
33 _plugged_list = NULL;35 _plugged_list = NULL;
@@ -115,7 +117,7 @@
115}117}
116118
117// --------------------------------------------------------------------------------119// --------------------------------------------------------------------------------
118GtkWidget *Module::GetWidget (gchar *name)120GtkWidget *Module::GetWidget (const gchar *name)
119{121{
120 return _glade->GetWidget (name);122 return _glade->GetWidget (name);
121}123}
122124
=== modified file 'sources/module.hpp'
--- sources/module.hpp 2010-12-13 21:03:47 +0000
+++ sources/module.hpp 2011-01-21 08:07:55 +0000
@@ -47,7 +47,7 @@
4747
48 GtkWidget *GetRootWidget ();48 GtkWidget *GetRootWidget ();
4949
50 GtkWidget *GetWidget (gchar *name);50 GtkWidget *GetWidget (const gchar *name);
5151
52 virtual void SetFilter (Filter *filter);52 virtual void SetFilter (Filter *filter);
5353
@@ -57,13 +57,13 @@
57 Filter *_filter;57 Filter *_filter;
58 Glade *_glade;58 Glade *_glade;
5959
60 static const gdouble PRINT_HEADER_HEIGHT = 10.0; // % of paper width60 static const gdouble PRINT_HEADER_HEIGHT;
61 static const gdouble PRINT_FONT_HEIGHT = 2.0; // % of paper width61 static const gdouble PRINT_FONT_HEIGHT;
6262
63 static GKeyFile *_config_file;63 static GKeyFile *_config_file;
6464
65 Module (gchar *glade_file,65 Module (const gchar *glade_file,
66 gchar *root = NULL);66 const gchar *root = NULL);
6767
68 virtual void OnPlugged () {};68 virtual void OnPlugged () {};
69 virtual void OnUnPlugged () {};69 virtual void OnUnPlugged () {};
7070
=== modified file 'sources/object.cpp'
--- sources/object.cpp 2010-06-30 21:14:15 +0000
+++ sources/object.cpp 2011-01-21 08:07:55 +0000
@@ -28,7 +28,7 @@
28};28};
2929
30// --------------------------------------------------------------------------------30// --------------------------------------------------------------------------------
31Object::Object (gchar *class_name)31Object::Object (const gchar *class_name)
32{32{
33 g_datalist_init (&_datalist);33 g_datalist_init (&_datalist);
34 _ref_count = 1;34 _ref_count = 1;
@@ -37,10 +37,12 @@
37#ifdef DEBUG37#ifdef DEBUG
38 if (class_name == NULL)38 if (class_name == NULL)
39 {39 {
40 class_name = "anonymous";40 _class_name = g_strdup ("anonymous");
41 }41 }
4242 else
43 _class_name = class_name;43 {
44 _class_name = g_strdup (class_name);
45 }
4446
45 for (guint i = 0; i < g_list_length (_list); i++)47 for (guint i = 0; i < g_list_length (_list); i++)
46 {48 {
@@ -90,6 +92,9 @@
90 return;92 return;
91 }93 }
92 }94 }
95
96 g_free (_class_name);
97
93#endif98#endif
94}99}
95100
@@ -130,11 +135,11 @@
130135
131// --------------------------------------------------------------------------------136// --------------------------------------------------------------------------------
132void Object::SetData (Object *owner,137void Object::SetData (Object *owner,
133 gchar *key,138 const gchar *key,
134 void *data,139 void *data,
135 GDestroyNotify destroy_cbk)140 GDestroyNotify destroy_cbk)
136{141{
137 gchar *full_key = g_strdup_printf ("%p::%s", owner, key);142 gchar *full_key = g_strdup_printf ("%p::%s", (void *) owner, key);
138143
139 g_datalist_set_data_full (&_datalist,144 g_datalist_set_data_full (&_datalist,
140 full_key,145 full_key,
@@ -144,10 +149,10 @@
144}149}
145150
146// --------------------------------------------------------------------------------151// --------------------------------------------------------------------------------
147void Object::RemoveData (Object *owner,152void Object::RemoveData (Object *owner,
148 gchar *key)153 const gchar *key)
149{154{
150 gchar *full_key = g_strdup_printf ("%p::%s", owner, key);155 gchar *full_key = g_strdup_printf ("%p::%s", (void *) owner, key);
151156
152 g_datalist_remove_data (&_datalist,157 g_datalist_remove_data (&_datalist,
153 full_key);158 full_key);
@@ -165,11 +170,11 @@
165}170}
166171
167// --------------------------------------------------------------------------------172// --------------------------------------------------------------------------------
168void *Object::GetData (Object *owner,173void *Object::GetData (Object *owner,
169 gchar *key)174 const gchar *key)
170{175{
171 void *data;176 void *data;
172 gchar *full_key = g_strdup_printf ("%p::%s", owner, key);177 gchar *full_key = g_strdup_printf ("%p::%s", (void *) owner, key);
173178
174 data = g_datalist_get_data (&_datalist,179 data = g_datalist_get_data (&_datalist,
175 full_key);180 full_key);
176181
=== modified file 'sources/object.hpp'
--- sources/object.hpp 2010-09-21 12:47:35 +0000
+++ sources/object.hpp 2011-01-21 08:07:55 +0000
@@ -24,18 +24,18 @@
24class Object24class Object
25{25{
26 public:26 public:
27 Object (gchar *class_name = NULL);27 Object (const gchar *class_name = NULL);
2828
29 void SetData (Object *owner,29 void SetData (Object *owner,
30 gchar *key,30 const gchar *key,
31 void *data,31 void *data,
32 GDestroyNotify destroy_cbk = NULL);32 GDestroyNotify destroy_cbk = NULL);
3333
34 void *GetData (Object *owner,34 void *GetData (Object *owner,
35 gchar *key);35 const gchar *key);
3636
37 void RemoveData (Object *owner,37 void RemoveData (Object *owner,
38 gchar *key);38 const gchar *key);
3939
40 void Retain ();40 void Retain ();
4141
4242
=== modified file 'sources/player.cpp'
--- sources/player.cpp 2010-12-02 21:35:29 +0000
+++ sources/player.cpp 2011-01-21 08:07:55 +0000
@@ -167,13 +167,13 @@
167}167}
168168
169// --------------------------------------------------------------------------------169// --------------------------------------------------------------------------------
170void Player::SetChangeCbk (gchar *attr_name,170void Player::SetChangeCbk (const gchar *attr_name,
171 OnChange change_cbk,171 OnChange change_cbk,
172 void *data)172 void *data)
173{173{
174 Client *client = new Client;174 Client *client = new Client;
175175
176 client->_attr_name = attr_name;176 client->_attr_name = g_strdup (attr_name);
177 client->_change_cbk = change_cbk;177 client->_change_cbk = change_cbk;
178 client->_data = data;178 client->_data = data;
179179
@@ -203,7 +203,7 @@
203203
204// --------------------------------------------------------------------------------204// --------------------------------------------------------------------------------
205void Player::SetAttributeValue (AttributeId *attr_id,205void Player::SetAttributeValue (AttributeId *attr_id,
206 gchar *value)206 const gchar *value)
207{207{
208 Attribute *attr = GetAttribute (attr_id);208 Attribute *attr = GetAttribute (attr_id);
209209
210210
=== modified file 'sources/player.hpp'
--- sources/player.hpp 2010-10-13 13:09:59 +0000
+++ sources/player.hpp 2011-01-21 08:07:55 +0000
@@ -29,10 +29,10 @@
29 class AttributeId : public Object29 class AttributeId : public Object
30 {30 {
31 public:31 public:
32 AttributeId (gchar *name,32 AttributeId (const gchar *name,
33 Object *owner = NULL)33 Object *owner = NULL)
34 {34 {
35 _name = name;35 _name = g_strdup (name);
36 _owner = owner;36 _owner = owner;
37 _rand_seed = 0;37 _rand_seed = 0;
38 }38 }
@@ -62,7 +62,7 @@
62 Attribute *GetAttribute (AttributeId *attr_id);62 Attribute *GetAttribute (AttributeId *attr_id);
6363
64 void SetAttributeValue (AttributeId *attr_id,64 void SetAttributeValue (AttributeId *attr_id,
65 gchar *value);65 const gchar *value);
6666
67 void SetAttributeValue (AttributeId *attr_id,67 void SetAttributeValue (AttributeId *attr_id,
68 guint value);68 guint value);
@@ -75,9 +75,9 @@
7575
76 gchar *GetName ();76 gchar *GetName ();
7777
78 void SetChangeCbk (gchar *attr_name,78 void SetChangeCbk (const gchar *attr_name,
79 OnChange change_cbk,79 OnChange change_cbk,
80 void *data);80 void *data);
8181
82 static gint CompareWithRef (Player *player,82 static gint CompareWithRef (Player *player,
83 guint ref);83 guint ref);
8484
=== modified file 'sources/players_list.cpp'
--- sources/players_list.cpp 2010-11-30 07:58:46 +0000
+++ sources/players_list.cpp 2011-01-21 08:07:55 +0000
@@ -25,8 +25,8 @@
25#include "players_list.hpp"25#include "players_list.hpp"
2626
27// --------------------------------------------------------------------------------27// --------------------------------------------------------------------------------
28 PlayersList::PlayersList (gchar *glade_file,28 PlayersList::PlayersList (const gchar *glade_file,
29 guint rights)29 guint rights)
30: Module (glade_file)30: Module (glade_file)
31{31{
32 _rights = rights;32 _rights = rights;
@@ -494,8 +494,8 @@
494}494}
495495
496// --------------------------------------------------------------------------------496// --------------------------------------------------------------------------------
497void PlayersList::SetAttributeRight (gchar *name,497void PlayersList::SetAttributeRight (const gchar *name,
498 gboolean modifiable)498 gboolean modifiable)
499{499{
500 AttributeDesc *desc = AttributeDesc::GetDesc (name);500 AttributeDesc *desc = AttributeDesc::GetDesc (name);
501501
502502
=== modified file 'sources/players_list.hpp'
--- sources/players_list.hpp 2010-09-21 12:47:35 +0000
+++ sources/players_list.hpp 2011-01-21 08:07:55 +0000
@@ -40,8 +40,8 @@
4040
41 typedef gboolean (*CustomFilter) (Player *player);41 typedef gboolean (*CustomFilter) (Player *player);
4242
43 PlayersList (gchar *glade_file,43 PlayersList (const gchar *glade_file,
44 guint rights = SORTABLE | MODIFIABLE);44 guint rights = SORTABLE | MODIFIABLE);
4545
46 ~PlayersList ();46 ~PlayersList ();
4747
@@ -59,8 +59,8 @@
5959
60 void SetFilter (Filter *filter);60 void SetFilter (Filter *filter);
6161
62 void SetAttributeRight (gchar *name,62 void SetAttributeRight (const gchar *name,
63 gboolean modifiable);63 gboolean modifiable);
6464
65 virtual void OnListChanged () {};65 virtual void OnListChanged () {};
6666
6767
=== modified file 'sources/pool.cpp'
--- sources/pool.cpp 2010-12-29 20:11:22 +0000
+++ sources/pool.cpp 2011-01-21 08:07:55 +0000
@@ -838,14 +838,14 @@
838}838}
839839
840// --------------------------------------------------------------------------------840// --------------------------------------------------------------------------------
841void Pool::SetDisplayData (Player *player,841void Pool::SetDisplayData (Player *player,
842 GooCanvas *on_canvas,842 GooCanvas *on_canvas,
843 gchar *name,843 const gchar *name,
844 void *value)844 void *value)
845{845{
846 player->SetData (GetDataOwner (), name, value);846 player->SetData (GetDataOwner (), name, value);
847847
848 _display_data = g_slist_prepend (_display_data, name);848 _display_data = g_slist_prepend (_display_data, (void *) name);
849}849}
850850
851// --------------------------------------------------------------------------------851// --------------------------------------------------------------------------------
@@ -921,19 +921,19 @@
921 guint HS_B;921 guint HS_B;
922 Player::AttributeId attr_id ("", data_owner);922 Player::AttributeId attr_id ("", data_owner);
923923
924 attr_id._name = "victories_ratio";924 attr_id._name = (gchar *) "victories_ratio";
925 ratio_A = (guint) A->GetAttribute (&attr_id)->GetValue ();925 ratio_A = (guint) A->GetAttribute (&attr_id)->GetValue ();
926 ratio_B = (guint) B->GetAttribute (&attr_id)->GetValue ();926 ratio_B = (guint) B->GetAttribute (&attr_id)->GetValue ();
927927
928 attr_id._name = "indice";928 attr_id._name = (gchar *) "indice";
929 average_A = (gint) A->GetAttribute (&attr_id)->GetValue ();929 average_A = (gint) A->GetAttribute (&attr_id)->GetValue ();
930 average_B = (gint) B->GetAttribute (&attr_id)->GetValue ();930 average_B = (gint) B->GetAttribute (&attr_id)->GetValue ();
931931
932 attr_id._name = "HS";932 attr_id._name = (gchar *) "HS";
933 HS_A = (guint) A->GetAttribute (&attr_id)->GetValue ();933 HS_A = (guint) A->GetAttribute (&attr_id)->GetValue ();
934 HS_B = (guint) B->GetAttribute (&attr_id)->GetValue ();934 HS_B = (guint) B->GetAttribute (&attr_id)->GetValue ();
935935
936 attr_id._name = "status";936 attr_id._name = (gchar *) "status";
937 attr_id._owner = main_data_owner;937 attr_id._owner = main_data_owner;
938 if (A->GetAttribute (&attr_id) && B->GetAttribute (&attr_id))938 if (A->GetAttribute (&attr_id) && B->GetAttribute (&attr_id))
939 {939 {
@@ -1195,7 +1195,7 @@
11951195
1196// --------------------------------------------------------------------------------1196// --------------------------------------------------------------------------------
1197void Pool::RefreshAttribute (Player *player,1197void Pool::RefreshAttribute (Player *player,
1198 gchar *name,1198 const gchar *name,
1199 guint value,1199 guint value,
1200 CombinedOperation operation)1200 CombinedOperation operation)
1201{1201{
@@ -1293,7 +1293,7 @@
1293 }1293 }
1294 }1294 }
12951295
1296 attr_id._name = "victories_ratio";1296 attr_id._name = (gchar *) "victories_ratio";
1297 attr = player->GetAttribute (&attr_id);1297 attr = player->GetAttribute (&attr_id);
1298 data = player->GetData (GetDataOwner (), "VictoriesRatioItem");1298 data = player->GetData (GetDataOwner (), "VictoriesRatioItem");
1299 if (data)1299 if (data)
@@ -1318,7 +1318,7 @@
1318 g_free (text);1318 g_free (text);
1319 }1319 }
13201320
1321 attr_id._name = "HS";1321 attr_id._name = (gchar *) "HS";
1322 attr = player->GetAttribute (&attr_id);1322 attr = player->GetAttribute (&attr_id);
1323 data = player->GetData (GetDataOwner (), "HSItem");1323 data = player->GetData (GetDataOwner (), "HSItem");
1324 if (data)1324 if (data)
@@ -1343,7 +1343,7 @@
1343 g_free (text);1343 g_free (text);
1344 }1344 }
13451345
1346 attr_id._name = "indice";1346 attr_id._name = (gchar *) "indice";
1347 attr = player->GetAttribute (&attr_id);1347 attr = player->GetAttribute (&attr_id);
1348 data = player->GetData (GetDataOwner (), "IndiceItem");1348 data = player->GetData (GetDataOwner (), "IndiceItem");
1349 if (data)1349 if (data)
@@ -1452,7 +1452,7 @@
1452 xmlTextWriterWriteFormatAttribute (xml_writer,1452 xmlTextWriterWriteFormatAttribute (xml_writer,
1453 BAD_CAST "NbMatches",1453 BAD_CAST "NbMatches",
1454 "%d", GetNbPlayers ()-1);1454 "%d", GetNbPlayers ()-1);
1455 attr_id._name = "HS";1455 attr_id._name = (gchar *) "HS";
1456 attr = player->GetAttribute (&attr_id);1456 attr = player->GetAttribute (&attr_id);
1457 if (attr)1457 if (attr)
1458 {1458 {
@@ -1460,7 +1460,7 @@
1460 xmlTextWriterWriteFormatAttribute (xml_writer,1460 xmlTextWriterWriteFormatAttribute (xml_writer,
1461 BAD_CAST "TD",1461 BAD_CAST "TD",
1462 "%d", HS);1462 "%d", HS);
1463 attr_id._name = "indice";1463 attr_id._name = (gchar *) "indice";
1464 indice = (guint) player->GetAttribute (&attr_id)->GetValue ();1464 indice = (guint) player->GetAttribute (&attr_id)->GetValue ();
1465 xmlTextWriterWriteFormatAttribute (xml_writer,1465 xmlTextWriterWriteFormatAttribute (xml_writer,
1466 BAD_CAST "TR",1466 BAD_CAST "TR",
14671467
=== modified file 'sources/pool.hpp'
--- sources/pool.hpp 2010-12-09 21:33:26 +0000
+++ sources/pool.hpp 2011-01-21 08:07:55 +0000
@@ -130,10 +130,10 @@
130130
131 void OnUnPlugged ();131 void OnUnPlugged ();
132132
133 void SetDisplayData (Player *player,133 void SetDisplayData (Player *player,
134 GooCanvas *on_canvas,134 GooCanvas *on_canvas,
135 gchar *name,135 const gchar *name,
136 void *value);136 void *value);
137137
138 void Draw (GooCanvas *on_canvas,138 void Draw (GooCanvas *on_canvas,
139 gboolean print_for_referees);139 gboolean print_for_referees);
@@ -151,7 +151,7 @@
151 void RefreshDashBoard ();151 void RefreshDashBoard ();
152152
153 void RefreshAttribute (Player *player,153 void RefreshAttribute (Player *player,
154 gchar *name,154 const gchar *name,
155 guint value,155 guint value,
156 CombinedOperation operation);156 CombinedOperation operation);
157157
158158
=== modified file 'sources/pool_allocator.cpp'
--- sources/pool_allocator.cpp 2010-12-14 13:21:36 +0000
+++ sources/pool_allocator.cpp 2011-01-21 08:07:55 +0000
@@ -1107,18 +1107,19 @@
1107 || ( _selected_config->has_two_size1107 || ( _selected_config->has_two_size
1108 && ((pool_size == _selected_config->size)) || (pool_size == _selected_config->size + 1)))1108 && ((pool_size == _selected_config->size)) || (pool_size == _selected_config->size + 1)))
1109 {1109 {
1110 icon_name = GTK_STOCK_APPLY;1110 icon_name = g_strdup (GTK_STOCK_APPLY);
1111 pool->SetData (this, "is_balanced", (void *) 1);1111 pool->SetData (this, "is_balanced", (void *) 1);
1112 }1112 }
1113 else1113 else
1114 {1114 {
1115 icon_name = GTK_STOCK_DIALOG_WARNING;1115 icon_name = g_strdup (GTK_STOCK_DIALOG_WARNING);
1116 pool->SetData (this, "is_balanced", 0);1116 pool->SetData (this, "is_balanced", 0);
1117 }1117 }
11181118
1119 Canvas::PutStockIconInTable (name_table,1119 Canvas::PutStockIconInTable (name_table,
1120 icon_name,1120 icon_name,
1121 0, 0);1121 0, 0);
1122 g_free (icon_name);
1122 }1123 }
11231124
1124 // Name1125 // Name
11251126
=== modified file 'sources/score_collector.cpp'
--- sources/score_collector.cpp 2010-11-30 21:45:57 +0000
+++ sources/score_collector.cpp 2011-01-21 08:07:55 +0000
@@ -540,8 +540,8 @@
540}540}
541541
542// --------------------------------------------------------------------------------542// --------------------------------------------------------------------------------
543void ScoreCollector::SetConsistentColors (gchar *normal_color,543void ScoreCollector::SetConsistentColors (const gchar *normal_color,
544 gchar *focus_color)544 const gchar *focus_color)
545{545{
546 g_free (_consistent_normal_color);546 g_free (_consistent_normal_color);
547 _consistent_normal_color = g_strdup (normal_color);547 _consistent_normal_color = g_strdup (normal_color);
548548
=== modified file 'sources/score_collector.hpp'
--- sources/score_collector.hpp 2010-04-18 21:11:47 +0000
+++ sources/score_collector.hpp 2011-01-21 08:07:55 +0000
@@ -61,8 +61,8 @@
61 void SetNextCollectingPoint (GooCanvasItem *to,61 void SetNextCollectingPoint (GooCanvasItem *to,
62 GooCanvasItem *next);62 GooCanvasItem *next);
6363
64 void SetConsistentColors (gchar *normal_color,64 void SetConsistentColors (const gchar *normal_color,
65 gchar *focus_color);65 const gchar *focus_color);
6666
67 void SetUnConsistentColors (gchar *normal_color,67 void SetUnConsistentColors (gchar *normal_color,
68 gchar *focus_colorg);68 gchar *focus_colorg);
6969
=== modified file 'sources/stage.hpp'
--- sources/stage.hpp 2010-11-17 11:21:48 +0000
+++ sources/stage.hpp 2011-01-21 08:07:55 +0000
@@ -125,7 +125,7 @@
125 virtual void Load (xmlNode *xml_node);125 virtual void Load (xmlNode *xml_node);
126126
127 virtual void Load (xmlXPathContext *xml_context,127 virtual void Load (xmlXPathContext *xml_context,
128 gchar *from_node) {};128 const gchar *from_node) {};
129129
130 virtual void Save (xmlTextWriter *xml_writer) {};130 virtual void Save (xmlTextWriter *xml_writer) {};
131131
132132
=== modified file 'sources/table.cpp'
--- sources/table.cpp 2010-12-29 07:36:17 +0000
+++ sources/table.cpp 2011-01-21 08:07:55 +0000
@@ -29,6 +29,7 @@
2929
30const gchar *Table::_class_name = N_("Table");30const gchar *Table::_class_name = N_("Table");
31const gchar *Table::_xml_class_name = "PhaseDeTableaux";31const gchar *Table::_xml_class_name = "PhaseDeTableaux";
32const gdouble Table::_score_rect_size = 30.0;
32const gdouble Table::_level_spacing = 10.0;33const gdouble Table::_level_spacing = 10.0;
3334
34typedef enum35typedef enum
@@ -246,7 +247,7 @@
246}247}
247248
248// --------------------------------------------------------------------------------249// --------------------------------------------------------------------------------
249GooCanvasItem *Table::GetQuickScore (gchar *container)250GooCanvasItem *Table::GetQuickScore (const gchar *container)
250{251{
251 GtkWidget *view_port = _glade->GetWidget (container);252 GtkWidget *view_port = _glade->GetWidget (container);
252 GooCanvas *canvas = GOO_CANVAS (goo_canvas_new ());253 GooCanvas *canvas = GOO_CANVAS (goo_canvas_new ());
@@ -317,15 +318,15 @@
317318
318 if (_level_status[i]._has_error)319 if (_level_status[i]._has_error)
319 {320 {
320 icon = GTK_STOCK_DIALOG_WARNING;321 icon = g_strdup (GTK_STOCK_DIALOG_WARNING);
321 }322 }
322 else if (_level_status[i]._is_over == TRUE)323 else if (_level_status[i]._is_over == TRUE)
323 {324 {
324 icon = GTK_STOCK_APPLY;325 icon = g_strdup (GTK_STOCK_APPLY);
325 }326 }
326 else327 else
327 {328 {
328 icon = GTK_STOCK_EXECUTE;329 icon = g_strdup (GTK_STOCK_EXECUTE);
329 }330 }
330331
331 _level_status[i]._status_item = Canvas::PutStockIconInTable (_level_status[i-nb_missing_level]._level_header,332 _level_status[i]._status_item = Canvas::PutStockIconInTable (_level_status[i-nb_missing_level]._level_header,
@@ -339,6 +340,7 @@
339 gtk_list_store_set (_from_table_liststore, &iter,340 gtk_list_store_set (_from_table_liststore, &iter,
340 FROM_STATUS_COLUMN, icon,341 FROM_STATUS_COLUMN, icon,
341 -1);342 -1);
343 g_free (icon);
342 }344 }
343 }345 }
344 SignalStatusUpdate ();346 SignalStatusUpdate ();
@@ -954,7 +956,7 @@
954956
955 if (parent_data->_match->IsDropped () == FALSE)957 if (parent_data->_match->IsDropped () == FALSE)
956 {958 {
957 text = "Q";959 text = (gchar *) "Q";
958 }960 }
959 else961 else
960 {962 {
961963
=== modified file 'sources/table.hpp'
--- sources/table.hpp 2010-12-19 17:35:40 +0000
+++ sources/table.hpp 2011-01-21 08:07:55 +0000
@@ -60,7 +60,7 @@
60 gint page_nr);60 gint page_nr);
6161
62 private:62 private:
63 static const gdouble _score_rect_size = 30.0;63 static const gdouble _score_rect_size;
6464
65 struct LevelStatus65 struct LevelStatus
66 {66 {
@@ -110,7 +110,7 @@
110 guint _print_nb_y_pages;110 guint _print_nb_y_pages;
111 GData *_match_list;111 GData *_match_list;
112112
113 GooCanvasItem *GetQuickScore (gchar *container);113 GooCanvasItem *GetQuickScore (const gchar *container);
114114
115 void Display ();115 void Display ();
116116

Subscribers

People subscribed via source and target branches

to all changes: