1 |
remi 11/02/26 14:47:10 |
2 |
|
3 |
Added: 0.8.2-0004-fix-memory-leaks-thanks-Philippe-D.patch |
4 |
0.8.2-0005-fixes-bug-of-compilation.patch |
5 |
0.8.2-0002-fixes-a-crash-when-importing-a-file-without-extensio.patch |
6 |
0.8.2-0003-fixes-bug-1293-Problem-of-updating-of-the-pointing-b.patch |
7 |
0.8.2-0001-fixes-bug-1289.patch |
8 |
Log: |
9 |
Bump to 0.8.2 (with patches from upstream) |
10 |
|
11 |
(Portage version: 2.2.0_alpha23/cvs/Linux i686) |
12 |
|
13 |
Revision Changes Path |
14 |
1.1 app-office/grisbi/files/0.8.2-0004-fix-memory-leaks-thanks-Philippe-D.patch |
15 |
|
16 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0004-fix-memory-leaks-thanks-Philippe-D.patch?rev=1.1&view=markup |
17 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0004-fix-memory-leaks-thanks-Philippe-D.patch?rev=1.1&content-type=text/plain |
18 |
|
19 |
Index: 0.8.2-0004-fix-memory-leaks-thanks-Philippe-D.patch |
20 |
=================================================================== |
21 |
From 5e25d0add90786446d6083ac46c8f374ae1463cc Mon Sep 17 00:00:00 2001 |
22 |
From: pbiava <pierre.biava@×××××.net> |
23 |
Date: Fri, 25 Feb 2011 21:33:51 +0100 |
24 |
Subject: [PATCH 4/5] fix memory leaks thanks Philippe D. |
25 |
|
26 |
--- |
27 |
src/bet_data.c | 199 +++++++++++++++++++++++++++++++----------- |
28 |
src/gsb_assistant_account.c | 1 + |
29 |
src/gsb_file_config.c | 3 + |
30 |
src/gsb_file_load.c | 3 + |
31 |
src/gsb_select_icon.c | 12 ++- |
32 |
src/import.c | 5 +- |
33 |
src/import_csv.c | 3 + |
34 |
src/utils.c | 1 + |
35 |
src/utils_dates.c | 5 +- |
36 |
src/utils_editables.c | 3 + |
37 |
src/utils_files.c | 3 +- |
38 |
src/utils_str.c | 11 ++- |
39 |
12 files changed, 188 insertions(+), 61 deletions(-) |
40 |
|
41 |
diff --git a/src/bet_data.c b/src/bet_data.c |
42 |
index 0c9f7e5..fbc25d7 100644 |
43 |
--- a/src/bet_data.c |
44 |
+++ b/src/bet_data.c |
45 |
@@ -264,13 +264,19 @@ gboolean bet_data_hist_add_div ( gint account_number, |
46 |
{ |
47 |
gchar *key; |
48 |
gchar *sub_key; |
49 |
+ gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
50 |
struct_hist_div *shd; |
51 |
|
52 |
+ div_number_str = utils_str_itoa ( div_number ); |
53 |
if ( account_number == 0 ) |
54 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
55 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
56 |
else |
57 |
- key = g_strconcat ( utils_str_itoa ( account_number ), ":", |
58 |
- utils_str_itoa ( div_number ), NULL ); |
59 |
+ { |
60 |
+ account_number_str = utils_str_itoa ( account_number ); |
61 |
+ key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
62 |
+ g_free ( account_number_str ); |
63 |
+ } |
64 |
+ g_free ( div_number_str ); |
65 |
|
66 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
67 |
{ |
68 |
@@ -342,13 +348,19 @@ void bet_data_insert_div_hist ( struct_hist_div *shd, struct_hist_div *sub_shd ) |
69 |
{ |
70 |
gchar *key; |
71 |
gchar *sub_key; |
72 |
+ gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
73 |
struct_hist_div *tmp_shd; |
74 |
|
75 |
+ div_number_str = utils_str_itoa ( shd -> div_number ); |
76 |
if ( shd -> account_nb == 0 ) |
77 |
- key = g_strconcat ("0:", utils_str_itoa ( shd -> div_number ), NULL ); |
78 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
79 |
else |
80 |
- key = g_strconcat ( utils_str_itoa ( shd -> account_nb ), ":", |
81 |
- utils_str_itoa ( shd -> div_number ), NULL ); |
82 |
+ { |
83 |
+ account_nb_str = utils_str_itoa ( shd -> account_nb ); |
84 |
+ key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
85 |
+ g_free ( account_nb_str ); |
86 |
+ } |
87 |
+ g_free ( div_number_str ); |
88 |
|
89 |
if ( ( tmp_shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
90 |
{ |
91 |
@@ -383,13 +395,19 @@ gboolean bet_data_remove_div_hist ( gint account_number, gint div_number, gint s |
92 |
{ |
93 |
gchar *key; |
94 |
char *sub_key; |
95 |
+ gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
96 |
struct_hist_div *shd; |
97 |
|
98 |
+ div_number_str = utils_str_itoa ( div_number ); |
99 |
if ( account_number == 0 ) |
100 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
101 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
102 |
else |
103 |
- key = g_strconcat ( utils_str_itoa ( account_number ), ":", |
104 |
- utils_str_itoa ( div_number ), NULL ); |
105 |
+ { |
106 |
+ account_number_str = utils_str_itoa ( account_number ); |
107 |
+ key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
108 |
+ g_free ( account_number_str ); |
109 |
+ } |
110 |
+ g_free ( div_number_str ); |
111 |
|
112 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
113 |
{ |
114 |
@@ -418,14 +436,20 @@ gboolean bet_data_search_div_hist ( gint account_number, gint div_number, gint s |
115 |
{ |
116 |
gchar *key; |
117 |
gchar *sub_key; |
118 |
+ gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
119 |
gint origin; |
120 |
struct_hist_div *shd; |
121 |
|
122 |
+ div_number_str = utils_str_itoa ( div_number ); |
123 |
if ( account_number == 0 ) |
124 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
125 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
126 |
else |
127 |
- key = g_strconcat ( utils_str_itoa ( account_number ), ":", |
128 |
- utils_str_itoa ( div_number ), NULL ); |
129 |
+ { |
130 |
+ account_number_str = utils_str_itoa ( account_number ); |
131 |
+ key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
132 |
+ g_free ( account_number_str ); |
133 |
+ } |
134 |
+ g_free ( div_number_str ); |
135 |
|
136 |
origin = gsb_data_account_get_bet_hist_data ( account_number ); |
137 |
|
138 |
@@ -539,15 +563,21 @@ gchar *bet_data_get_div_name ( gint div_num, |
139 |
gboolean bet_data_get_div_edited ( gint account_number, gint div_number, gint sub_div_nb ) |
140 |
{ |
141 |
gchar *key; |
142 |
+ gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
143 |
gint origin; |
144 |
struct_hist_div *shd; |
145 |
gboolean edited; |
146 |
|
147 |
+ div_number_str = utils_str_itoa ( div_number ); |
148 |
if ( account_number == 0 ) |
149 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
150 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
151 |
else |
152 |
- key = g_strconcat ( utils_str_itoa ( account_number ), ":", |
153 |
- utils_str_itoa ( div_number ), NULL ); |
154 |
+ { |
155 |
+ account_number_str = utils_str_itoa ( account_number ); |
156 |
+ key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
157 |
+ g_free ( account_number_str ); |
158 |
+ } |
159 |
+ g_free ( div_number_str ); |
160 |
|
161 |
origin = gsb_data_account_get_bet_hist_data ( account_number ); |
162 |
|
163 |
@@ -589,13 +619,19 @@ gboolean bet_data_set_div_edited ( gint account_nb, |
164 |
gboolean edited ) |
165 |
{ |
166 |
gchar *key; |
167 |
+ gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
168 |
struct_hist_div *shd; |
169 |
|
170 |
+ div_number_str = utils_str_itoa ( div_number ); |
171 |
if ( account_nb == 0 ) |
172 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
173 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
174 |
else |
175 |
- key = g_strconcat ( utils_str_itoa ( account_nb ), ":", |
176 |
- utils_str_itoa ( div_number ), NULL ); |
177 |
+ { |
178 |
+ account_nb_str = utils_str_itoa ( account_nb ); |
179 |
+ key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
180 |
+ g_free ( account_nb_str ); |
181 |
+ } |
182 |
+ g_free ( div_number_str ); |
183 |
|
184 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
185 |
{ |
186 |
@@ -628,14 +664,20 @@ gboolean bet_data_set_div_edited ( gint account_nb, |
187 |
gsb_real bet_data_hist_get_div_amount ( gint account_nb, gint div_number, gint sub_div_nb ) |
188 |
{ |
189 |
gchar *key; |
190 |
+ gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
191 |
struct_hist_div *shd; |
192 |
gsb_real amount; |
193 |
|
194 |
+ div_number_str = utils_str_itoa ( div_number ); |
195 |
if ( account_nb == 0 ) |
196 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
197 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
198 |
else |
199 |
- key = g_strconcat ( utils_str_itoa ( account_nb ), ":", |
200 |
- utils_str_itoa ( div_number ), NULL ); |
201 |
+ { |
202 |
+ account_nb_str = utils_str_itoa ( account_nb ); |
203 |
+ key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
204 |
+ g_free ( account_nb_str ); |
205 |
+ } |
206 |
+ g_free ( div_number_str ); |
207 |
|
208 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
209 |
{ |
210 |
@@ -674,13 +716,19 @@ gboolean bet_data_set_div_amount ( gint account_nb, |
211 |
gsb_real amount ) |
212 |
{ |
213 |
gchar *key; |
214 |
+ gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
215 |
struct_hist_div *shd; |
216 |
|
217 |
+ div_number_str = utils_str_itoa ( div_number ); |
218 |
if ( account_nb == 0 ) |
219 |
- key = g_strconcat ("0:", utils_str_itoa ( div_number ), NULL ); |
220 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
221 |
else |
222 |
- key = g_strconcat ( utils_str_itoa ( account_nb ), ":", |
223 |
- utils_str_itoa ( div_number ), NULL ); |
224 |
+ { |
225 |
+ account_nb_str = utils_str_itoa ( account_nb ); |
226 |
+ key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
227 |
+ g_free ( account_nb_str ); |
228 |
+ } |
229 |
+ g_free ( div_number_str ); |
230 |
|
231 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
232 |
{ |
233 |
@@ -1167,16 +1215,22 @@ void struct_free_bet_future ( struct_futur_data *scheduled ) |
234 |
gboolean bet_data_future_add_lines ( struct_futur_data *scheduled ) |
235 |
{ |
236 |
gchar *key; |
237 |
+ gchar *future_number_str, *account_nb_str; // only to avoid memory leaks |
238 |
|
239 |
future_number ++; |
240 |
|
241 |
if ( scheduled -> frequency == 0 ) |
242 |
{ |
243 |
+ future_number_str = utils_str_itoa ( future_number ); |
244 |
if ( scheduled -> account_number == 0 ) |
245 |
- key = g_strconcat ("0:", utils_str_itoa ( future_number ), NULL ); |
246 |
+ key = g_strconcat ("0:", future_number_str, NULL ); |
247 |
else |
248 |
- key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":", |
249 |
- utils_str_itoa ( future_number ), NULL ); |
250 |
+ { |
251 |
+ account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
252 |
+ key = g_strconcat ( account_nb_str, ":", future_number_str, NULL ); |
253 |
+ g_free ( account_nb_str ); |
254 |
+ } |
255 |
+ g_free ( future_number_str ); |
256 |
|
257 |
scheduled -> number = future_number; |
258 |
g_hash_table_insert ( bet_future_list, key, scheduled ); |
259 |
@@ -1196,11 +1250,16 @@ gboolean bet_data_future_add_lines ( struct_futur_data *scheduled ) |
260 |
date = gsb_date_copy ( scheduled -> date ); |
261 |
while ( date != NULL && g_date_valid ( date ) ) |
262 |
{ |
263 |
+ future_number_str = utils_str_itoa ( future_number ); |
264 |
if ( scheduled -> account_number == 0 ) |
265 |
key = g_strconcat ("0:", utils_str_itoa ( future_number ), NULL ); |
266 |
else |
267 |
- key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":", |
268 |
- utils_str_itoa ( future_number ), NULL ); |
269 |
+ { |
270 |
+ account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
271 |
+ key = g_strconcat ( account_nb_str, ":", future_number_str, NULL ); |
272 |
+ g_free ( account_nb_str ); |
273 |
+ } |
274 |
+ g_free ( future_number_str ); |
275 |
|
276 |
if ( mother_row == future_number ) |
277 |
new_sch = scheduled; |
278 |
@@ -1236,16 +1295,22 @@ gboolean bet_data_future_add_lines ( struct_futur_data *scheduled ) |
279 |
gboolean bet_data_future_set_lines_from_file ( struct_futur_data *scheduled ) |
280 |
{ |
281 |
gchar *key; |
282 |
+ gchar *number_str, *account_nb_str; // only to avoid memory leaks |
283 |
|
284 |
- if ( scheduled -> account_number == 0 ) |
285 |
- key = g_strconcat ("0:", utils_str_itoa ( scheduled -> number ), NULL ); |
286 |
- else |
287 |
- key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":", |
288 |
- utils_str_itoa ( scheduled -> number ), NULL ); |
289 |
+ number_str = utils_str_itoa ( scheduled -> number ); |
290 |
+ if ( scheduled -> account_number == 0 ) |
291 |
+ key = g_strconcat ("0:", number_str, NULL ); |
292 |
+ else |
293 |
+ { |
294 |
+ account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
295 |
+ key = g_strconcat ( account_nb_str, ":", number_str, NULL ); |
296 |
+ g_free ( account_nb_str ); |
297 |
+ } |
298 |
+ g_free ( number_str ); |
299 |
|
300 |
- bet_data_future_set_max_number ( scheduled -> number ); |
301 |
+ bet_data_future_set_max_number ( scheduled -> number ); |
302 |
|
303 |
- g_hash_table_insert ( bet_future_list, key, scheduled ); |
304 |
+ g_hash_table_insert ( bet_future_list, key, scheduled ); |
305 |
|
306 |
return TRUE; |
307 |
} |
308 |
@@ -1557,12 +1622,18 @@ GDate *bet_data_array_get_date_max ( gint account_number ) |
309 |
gboolean bet_data_future_modify_lines ( struct_futur_data *scheduled ) |
310 |
{ |
311 |
gchar *key; |
312 |
+ gchar *number_str, *account_nb_str; // only to avoid memory leaks |
313 |
|
314 |
+ number_str = utils_str_itoa ( scheduled -> number ); |
315 |
if ( scheduled -> account_number == 0 ) |
316 |
- key = g_strconcat ("0:", utils_str_itoa ( scheduled -> number ), NULL ); |
317 |
+ key = g_strconcat ("0:", number_str, NULL ); |
318 |
else |
319 |
- key = g_strconcat ( utils_str_itoa ( scheduled -> account_number ), ":", |
320 |
- utils_str_itoa ( scheduled -> number ), NULL ); |
321 |
+ { |
322 |
+ account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
323 |
+ key = g_strconcat ( account_nb_str, ":", number_str, NULL ); |
324 |
+ g_free ( account_nb_str ); |
325 |
+ } |
326 |
+ g_free ( number_str ); |
327 |
|
328 |
g_hash_table_replace ( bet_future_list, key, scheduled ); |
329 |
|
330 |
@@ -1582,13 +1653,19 @@ gboolean bet_data_future_modify_lines ( struct_futur_data *scheduled ) |
331 |
struct_futur_data *bet_data_future_get_struct ( gint account_number, gint number ) |
332 |
{ |
333 |
gchar *key; |
334 |
+ gchar *number_str, *account_nb_str; // only to avoid memory leaks |
335 |
struct_futur_data *scheduled; |
336 |
|
337 |
- if ( account_number == 0 ) |
338 |
- key = g_strconcat ("0:", utils_str_itoa ( number ), NULL ); |
339 |
+ number_str = utils_str_itoa ( number ); |
340 |
+ if ( scheduled -> account_number == 0 ) |
341 |
+ key = g_strconcat ("0:", number_str, NULL ); |
342 |
else |
343 |
- key = g_strconcat ( utils_str_itoa ( account_number ), ":", |
344 |
- utils_str_itoa ( number ), NULL ); |
345 |
+ { |
346 |
+ account_nb_str = utils_str_itoa ( account_number ); |
347 |
+ key = g_strconcat ( account_nb_str, ":", number_str, NULL ); |
348 |
+ g_free ( account_nb_str ); |
349 |
+ } |
350 |
+ g_free ( number_str ); |
351 |
|
352 |
if ( ( scheduled = g_hash_table_lookup ( bet_future_list, key ) ) ) |
353 |
return scheduled; |
354 |
@@ -1651,14 +1728,20 @@ GHashTable *bet_data_transfert_get_list ( void ) |
355 |
gboolean bet_data_transfert_add_line ( struct_transfert_data *transfert ) |
356 |
{ |
357 |
gchar *key; |
358 |
+ gchar *transfert_nb_str, *account_nb_str; // only to avoid memory leaks |
359 |
|
360 |
transfert_number ++; |
361 |
|
362 |
+ transfert_nb_str = utils_str_itoa ( transfert_number ); |
363 |
if ( transfert -> account_number == 0 ) |
364 |
- key = g_strconcat ("0:", utils_str_itoa ( transfert_number ), NULL ); |
365 |
+ key = g_strconcat ("0:", transfert_nb_str, NULL ); |
366 |
else |
367 |
- key = g_strconcat ( utils_str_itoa ( transfert -> account_number ), ":", |
368 |
- utils_str_itoa ( transfert_number ), NULL ); |
369 |
+ { |
370 |
+ account_nb_str = utils_str_itoa ( transfert -> account_number ); |
371 |
+ key = g_strconcat ( account_nb_str, ":", transfert_nb_str, NULL ); |
372 |
+ g_free ( account_nb_str ); |
373 |
+ } |
374 |
+ g_free ( transfert_nb_str ); |
375 |
|
376 |
transfert -> number = transfert_number; |
377 |
g_hash_table_insert ( bet_transfert_list, key, transfert ); |
378 |
@@ -1715,12 +1798,18 @@ gboolean bet_data_transfert_remove_line ( gint account_number, gint number ) |
379 |
gboolean bet_data_transfert_set_line_from_file ( struct_transfert_data *transfert ) |
380 |
{ |
381 |
gchar *key; |
382 |
+ gchar *transfert_nb_str, *account_nb_str; // only to avoid memory leaks |
383 |
|
384 |
+ transfert_nb_str = utils_str_itoa ( transfert -> number ); |
385 |
if ( transfert -> account_number == 0 ) |
386 |
- key = g_strconcat ("0:", utils_str_itoa ( transfert -> number ), NULL ); |
387 |
+ key = g_strconcat ("0:", transfert_nb_str, NULL ); |
388 |
else |
389 |
- key = g_strconcat ( utils_str_itoa ( transfert -> account_number ), ":", |
390 |
- utils_str_itoa ( transfert -> number ), NULL ); |
391 |
+ { |
392 |
+ account_nb_str = utils_str_itoa ( transfert -> account_number ); |
393 |
+ key = g_strconcat ( account_nb_str, ":", transfert_nb_str, NULL ); |
394 |
+ g_free ( account_nb_str ); |
395 |
+ } |
396 |
+ g_free ( transfert_nb_str ); |
397 |
|
398 |
if ( transfert -> number > transfert_number ) |
399 |
transfert_number = transfert -> number; |
400 |
@@ -1740,12 +1829,18 @@ gboolean bet_data_transfert_set_line_from_file ( struct_transfert_data *transfer |
401 |
gboolean bet_data_transfert_modify_line ( struct_transfert_data *transfert ) |
402 |
{ |
403 |
gchar *key; |
404 |
+ gchar *transfert_nb_str, *account_nb_str; // only to avoid memory leaks |
405 |
|
406 |
+ transfert_nb_str = utils_str_itoa ( transfert -> number ); |
407 |
if ( transfert -> account_number == 0 ) |
408 |
- key = g_strconcat ("0:", utils_str_itoa ( transfert -> number ), NULL ); |
409 |
+ key = g_strconcat ("0:", transfert_nb_str, NULL ); |
410 |
else |
411 |
- key = g_strconcat ( utils_str_itoa ( transfert -> account_number ), ":", |
412 |
- utils_str_itoa ( transfert -> number ), NULL ); |
413 |
+ { |
414 |
+ account_nb_str = utils_str_itoa ( transfert -> account_number ); |
415 |
+ key = g_strconcat ( account_nb_str, ":", transfert_nb_str, NULL ); |
416 |
+ g_free ( account_nb_str ); |
417 |
+ } |
418 |
+ g_free ( transfert_nb_str ); |
419 |
|
420 |
g_hash_table_replace ( bet_transfert_list, key, transfert ); |
421 |
|
422 |
diff --git a/src/gsb_assistant_account.c b/src/gsb_assistant_account.c |
423 |
index 84f1caf..83eb348 100644 |
424 |
--- a/src/gsb_assistant_account.c |
425 |
+++ b/src/gsb_assistant_account.c |
426 |
@@ -498,6 +498,7 @@ void gsb_assistant_account_change_account_icon ( GtkWidget *button, gpointer dat |
427 |
{ |
428 |
devel_debug ( error -> message ); |
429 |
dialogue_error ( error -> message ); |
430 |
+ g_error_free ( error ); |
431 |
} |
432 |
else |
433 |
{ |
434 |
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c |
435 |
index 851552c..6dcfb94 100644 |
436 |
--- a/src/gsb_file_config.c |
437 |
+++ b/src/gsb_file_config.c |
438 |
@@ -1540,7 +1540,10 @@ gchar *gsb_config_get_old_conf_name ( void ) |
439 |
} |
440 |
} |
441 |
else |
442 |
+ { |
443 |
dialogue_error ( error -> message ); |
444 |
+ g_error_free ( error ); |
445 |
+ } |
446 |
|
447 |
if ( g_slist_length ( liste ) == 0 ) |
448 |
return NULL; |
449 |
diff --git a/src/gsb_file_load.c b/src/gsb_file_load.c |
450 |
index f5be275..4c78fb8 100644 |
451 |
--- a/src/gsb_file_load.c |
452 |
+++ b/src/gsb_file_load.c |
453 |
@@ -9027,7 +9027,10 @@ void gsb_file_load_copy_old_file ( gchar *filename, gchar *file_content) |
454 |
file_copy = g_file_new_for_path ( copy_old_filename ); |
455 |
if ( !g_file_copy ( file_ori, file_copy, G_FILE_COPY_OVERWRITE, |
456 |
NULL, NULL, NULL, &error ) ) |
457 |
+ { |
458 |
dialogue_error (error -> message ); |
459 |
+ g_error_free ( error ); |
460 |
+ } |
461 |
} |
462 |
} |
463 |
/* Local Variables: */ |
464 |
diff --git a/src/gsb_select_icon.c b/src/gsb_select_icon.c |
465 |
index bbbf6d9..7a75142 100644 |
466 |
--- a/src/gsb_select_icon.c |
467 |
+++ b/src/gsb_select_icon.c |
468 |
@@ -369,7 +369,10 @@ GtkTreePath * gsb_select_icon_fill_icon_view ( gchar * name_icon ) |
469 |
g_dir_close ( dir ); |
470 |
} |
471 |
else |
472 |
+ { |
473 |
dialogue_error ( error -> message ); |
474 |
+ g_error_free ( error ); |
475 |
+ } |
476 |
|
477 |
if ( tree_path == NULL ) |
478 |
tree_path = gtk_tree_path_new_from_string ( "0" ); |
479 |
@@ -657,7 +660,10 @@ GdkPixbuf *gsb_select_icon_get_default_logo_pixbuf ( void ) |
480 |
(GRISBI_PIXMAPS_DIR, "grisbi-logo.png", NULL), &error ); |
481 |
|
482 |
if ( ! pixbuf ) |
483 |
+ { |
484 |
devel_debug ( error -> message ); |
485 |
+ g_error_free ( error ); |
486 |
+ } |
487 |
|
488 |
if ( gdk_pixbuf_get_width (pixbuf) > LOGO_WIDTH || |
489 |
gdk_pixbuf_get_height (pixbuf) > LOGO_HEIGHT ) |
490 |
@@ -890,6 +896,7 @@ gboolean gsb_select_icon_new_account_icon_from_file ( gint account_number, |
491 |
filename, NULL ); |
492 |
devel_debug ( tmp_str ); |
493 |
dialogue_error ( tmp_str ); |
494 |
+ g_error_free ( error ); |
495 |
g_free ( tmp_str ); |
496 |
g_free ( icon ); |
497 |
|
498 |
@@ -909,13 +916,12 @@ GdkPixbuf *gsb_select_icon_change_account_pixbuf ( gint account_number, |
499 |
{ |
500 |
GSList *list_tmp; |
501 |
GdkPixbuf *pixbuf; |
502 |
- GError *error = NULL; |
503 |
|
504 |
if ( icon_buffer |
505 |
&& |
506 |
icon_buffer -> account_number == account_number ) |
507 |
{ |
508 |
- pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, &error ); |
509 |
+ pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, NULL ); |
510 |
if ( pixbuf ) |
511 |
{ |
512 |
g_object_unref ( icon_buffer -> pixbuf ); |
513 |
@@ -937,7 +943,7 @@ GdkPixbuf *gsb_select_icon_change_account_pixbuf ( gint account_number, |
514 |
|
515 |
if ( icon -> account_number == account_number ) |
516 |
{ |
517 |
- pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, &error ); |
518 |
+ pixbuf = gdk_pixbuf_new_from_file_at_size ( filename , 32, 32, NULL ); |
519 |
if ( pixbuf ) |
520 |
{ |
521 |
g_object_unref ( icon -> pixbuf ); |
522 |
diff --git a/src/import.c b/src/import.c |
523 |
index 1d5ceeb..5543aa1 100644 |
524 |
--- a/src/import.c |
525 |
+++ b/src/import.c |
526 |
@@ -534,6 +534,7 @@ gboolean import_switch_type ( GtkCellRendererText *cell, const gchar *path, |
527 |
if ( ! g_file_get_contents ( nom_fichier, &tmp_str, NULL, &error ) ) |
528 |
{ |
529 |
g_print ( _("Unable to read file: %s\n"), error -> message); |
530 |
+ g_error_free ( error ); |
531 |
return FALSE; |
532 |
} |
533 |
|
534 |
@@ -688,6 +689,7 @@ gboolean import_select_file ( GtkWidget * button, GtkWidget * assistant ) |
535 |
if ( ! g_file_get_contents ( iterator -> data, &tmp_str, NULL, &error ) ) |
536 |
{ |
537 |
g_print ( _("Unable to read file: %s\n"), error -> message); |
538 |
+ g_error_free ( error ); |
539 |
return FALSE; |
540 |
} |
541 |
|
542 |
@@ -4386,6 +4388,7 @@ gboolean gsb_import_by_rule ( gint rule ) |
543 |
if ( ! g_file_get_contents ( filename, &pointeur_char, NULL, &error ) ) |
544 |
{ |
545 |
g_print ( _("Unable to read file: %s\n"), error -> message); |
546 |
+ g_error_free ( error ); |
547 |
i++; |
548 |
continue; |
549 |
} |
550 |
@@ -4677,6 +4680,7 @@ gboolean gsb_import_set_tmp_file ( gchar *filename, |
551 |
{ |
552 |
g_free (contenu_fichier); |
553 |
g_print ( _("Unable to create tmp file: %s\n"), error -> message); |
554 |
+ g_error_free ( error ); |
555 |
return FALSE; |
556 |
} |
557 |
|
558 |
@@ -4710,7 +4714,6 @@ gboolean gsb_import_gunzip_file ( gchar *filename ) |
559 |
dialogue_error ( tmpstr ); |
560 |
g_free ( file_content); |
561 |
g_error_free (error); |
562 |
- |
563 |
return FALSE; |
564 |
} |
565 |
else |
566 |
diff --git a/src/import_csv.c b/src/import_csv.c |
567 |
index 88b1462..4b1707f 100644 |
568 |
--- a/src/import_csv.c |
569 |
+++ b/src/import_csv.c |
570 |
@@ -1081,6 +1081,7 @@ gboolean import_enter_csv_preview_page ( GtkWidget * assistant ) |
571 |
if ( ! g_file_get_contents ( filename, &tmp_str, &size, &error ) ) |
572 |
{ |
573 |
g_print ( _("Unable to read file: %s\n"), error -> message); |
574 |
+ g_error_free ( error ); |
575 |
return FALSE; |
576 |
} |
577 |
|
578 |
@@ -1091,6 +1092,7 @@ gboolean import_enter_csv_preview_page ( GtkWidget * assistant ) |
579 |
|
580 |
if ( contents == NULL ) |
581 |
{ |
582 |
+ g_error_free ( error ); |
583 |
error = NULL; |
584 |
size = 0; |
585 |
bytes_written = 0; |
586 |
@@ -1105,6 +1107,7 @@ gboolean import_enter_csv_preview_page ( GtkWidget * assistant ) |
587 |
if ( bytes_written == 0 ) |
588 |
{ |
589 |
g_print ( _("Unable to read file: %s\n"), error -> message); |
590 |
+ g_error_free ( error ); |
591 |
return FALSE; |
592 |
} |
593 |
} |
594 |
diff --git a/src/utils.c b/src/utils.c |
595 |
index 16361ef..aeb64ef 100644 |
596 |
--- a/src/utils.c |
597 |
+++ b/src/utils.c |
598 |
@@ -555,6 +555,7 @@ void lance_mailer ( const gchar *uri ) |
599 |
tmp_str = g_strdup_printf ( _("Grisbi was unable to execute a mailer to write at <tt>%s</tt>.\n" |
600 |
"The error was: %s."), |
601 |
uri, error -> message ); |
602 |
+ g_error_free ( error ); |
603 |
dialogue_error_hint ( tmp_str, _("Cannot execute mailer") ); |
604 |
g_free(tmp_str); |
605 |
} |
606 |
diff --git a/src/utils_dates.c b/src/utils_dates.c |
607 |
index 4f45bb2..c84118e 100644 |
608 |
--- a/src/utils_dates.c |
609 |
+++ b/src/utils_dates.c |
610 |
@@ -79,6 +79,7 @@ gchar *gsb_date_today ( void ) |
611 |
date = gdate_today ( ); |
612 |
date_string = gsb_format_gdate ( date ); |
613 |
gsb_date_set_last_date ( date_string ); |
614 |
+ g_free ( date_string ); |
615 |
g_date_free ( date ); |
616 |
} |
617 |
return (last_date); |
618 |
@@ -678,8 +679,10 @@ gchar *gsb_date_get_compiled_time ( void ) |
619 |
|
620 |
date = g_date_new_dmy ( atoi ( tab[1] ), mois, atoi ( tab[2] ) ); |
621 |
g_strfreev (tab); |
622 |
+ str = gsb_format_gdate ( date ); |
623 |
+ g_date_free ( date ); |
624 |
|
625 |
- return gsb_format_gdate ( date ); |
626 |
+ return str; |
627 |
} |
628 |
|
629 |
|
630 |
diff --git a/src/utils_editables.c b/src/utils_editables.c |
631 |
index ecfd082..6b15472 100644 |
632 |
--- a/src/utils_editables.c |
633 |
+++ b/src/utils_editables.c |
634 |
@@ -155,7 +155,10 @@ gsb_real gsb_utils_edit_calculate_entry ( GtkWidget *entry ) |
635 |
if ( string && strlen ( string ) ) |
636 |
pointeur = string + strlen ( string ); |
637 |
else |
638 |
+ { |
639 |
+ g_free ( string ); |
640 |
return total; |
641 |
+ } |
642 |
|
643 |
if ( g_utf8_strchr ( string, -1, '-' ) || g_utf8_strchr ( string, -1, '+' ) ) |
644 |
{ |
645 |
diff --git a/src/utils_files.c b/src/utils_files.c |
646 |
index d86629a..032db50 100644 |
647 |
--- a/src/utils_files.c |
648 |
+++ b/src/utils_files.c |
649 |
@@ -534,7 +534,6 @@ GSList *utils_files_check_UTF8_validity ( const gchar *contents, |
650 |
gint long_str = 0; |
651 |
gsize size = 0; |
652 |
gsize bytes_written = 0; |
653 |
- GError * error = NULL; |
654 |
gint i = 0; |
655 |
gchar *ptr; |
656 |
|
657 |
@@ -565,7 +564,7 @@ GSList *utils_files_check_UTF8_validity ( const gchar *contents, |
658 |
do |
659 |
{ |
660 |
tmp_str = g_convert ( string, long_str, "UTF-8", charset_array[i], |
661 |
- &size, &bytes_written, &error ); |
662 |
+ &size, &bytes_written, NULL ); |
663 |
if ( tmp_str ) |
664 |
{ |
665 |
result = g_malloc0 ( sizeof ( struct struc_check_encoding ) ); |
666 |
diff --git a/src/utils_str.c b/src/utils_str.c |
667 |
index 8c1e881..729a8a8 100644 |
668 |
--- a/src/utils_str.c |
669 |
+++ b/src/utils_str.c |
670 |
@@ -892,12 +892,16 @@ gchar *utils_str_dtostr ( gdouble number, gint nbre_decimal, gboolean canonical |
671 |
{ |
672 |
gchar buffer[G_ASCII_DTOSTR_BUF_SIZE]; |
673 |
gchar *str_number; |
674 |
+ gchar *decimal; |
675 |
gchar *format; |
676 |
gint nbre_char; |
677 |
|
678 |
- format = g_strconcat ( "%.", utils_str_itoa ( nbre_decimal ), "f", NULL ); |
679 |
- |
680 |
+ decimal = utils_str_itoa ( nbre_decimal ); |
681 |
+ format = g_strconcat ( "%.", decimal, "f", NULL ); |
682 |
nbre_char = g_sprintf ( buffer, format, number ); |
683 |
+ g_free ( decimal ); |
684 |
+ g_free ( format ); |
685 |
+ |
686 |
if ( nbre_char > G_ASCII_DTOSTR_BUF_SIZE ) |
687 |
return NULL; |
688 |
|
689 |
@@ -1004,7 +1008,10 @@ gchar *utils_str_incremente_number_from_str ( const gchar *str_number, gint incr |
690 |
new_str_number = utils_str_itoa ( number ); |
691 |
|
692 |
if ( prefix && strlen ( prefix ) > 0 ) |
693 |
+ { |
694 |
new_str_number = g_strconcat ( prefix, new_str_number, NULL ); |
695 |
+ g_free ( prefix ); |
696 |
+ } |
697 |
|
698 |
return new_str_number; |
699 |
} |
700 |
-- |
701 |
1.7.4 |
702 |
|
703 |
|
704 |
|
705 |
|
706 |
1.1 app-office/grisbi/files/0.8.2-0005-fixes-bug-of-compilation.patch |
707 |
|
708 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0005-fixes-bug-of-compilation.patch?rev=1.1&view=markup |
709 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0005-fixes-bug-of-compilation.patch?rev=1.1&content-type=text/plain |
710 |
|
711 |
Index: 0.8.2-0005-fixes-bug-of-compilation.patch |
712 |
=================================================================== |
713 |
From 6697ec365f3829f945b82888e59851657ca198ca Mon Sep 17 00:00:00 2001 |
714 |
From: pbiava <pierre.biava@×××××.net> |
715 |
Date: Fri, 25 Feb 2011 22:57:45 +0100 |
716 |
Subject: [PATCH 5/5] fixes bug of compilation |
717 |
|
718 |
--- |
719 |
src/bet_data.c | 221 ++++++++++++-------------------------------------------- |
720 |
1 files changed, 46 insertions(+), 175 deletions(-) |
721 |
|
722 |
diff --git a/src/bet_data.c b/src/bet_data.c |
723 |
index fbc25d7..d0067f3 100644 |
724 |
--- a/src/bet_data.c |
725 |
+++ b/src/bet_data.c |
726 |
@@ -55,6 +55,7 @@ static GDate *bet_data_futur_get_next_date ( struct_futur_data *scheduled, |
727 |
const GDate *date_max ); |
728 |
static struct_futur_data *bet_data_future_copy_struct ( struct_futur_data *scheduled ); |
729 |
static void bet_data_future_set_max_number ( gint number ); |
730 |
+static gchar *bet_data_get_key ( gint account_number, gint div_number ); |
731 |
static gboolean bet_data_update_div ( SH *sh, |
732 |
gint transaction_number, |
733 |
gint sub_div, |
734 |
@@ -264,19 +265,9 @@ gboolean bet_data_hist_add_div ( gint account_number, |
735 |
{ |
736 |
gchar *key; |
737 |
gchar *sub_key; |
738 |
- gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
739 |
struct_hist_div *shd; |
740 |
|
741 |
- div_number_str = utils_str_itoa ( div_number ); |
742 |
- if ( account_number == 0 ) |
743 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
744 |
- else |
745 |
- { |
746 |
- account_number_str = utils_str_itoa ( account_number ); |
747 |
- key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
748 |
- g_free ( account_number_str ); |
749 |
- } |
750 |
- g_free ( div_number_str ); |
751 |
+ key = bet_data_get_key ( account_number, div_number ); |
752 |
|
753 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
754 |
{ |
755 |
@@ -348,19 +339,9 @@ void bet_data_insert_div_hist ( struct_hist_div *shd, struct_hist_div *sub_shd ) |
756 |
{ |
757 |
gchar *key; |
758 |
gchar *sub_key; |
759 |
- gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
760 |
struct_hist_div *tmp_shd; |
761 |
|
762 |
- div_number_str = utils_str_itoa ( shd -> div_number ); |
763 |
- if ( shd -> account_nb == 0 ) |
764 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
765 |
- else |
766 |
- { |
767 |
- account_nb_str = utils_str_itoa ( shd -> account_nb ); |
768 |
- key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
769 |
- g_free ( account_nb_str ); |
770 |
- } |
771 |
- g_free ( div_number_str ); |
772 |
+ key = bet_data_get_key ( shd -> account_nb, shd -> div_number ); |
773 |
|
774 |
if ( ( tmp_shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
775 |
{ |
776 |
@@ -395,19 +376,9 @@ gboolean bet_data_remove_div_hist ( gint account_number, gint div_number, gint s |
777 |
{ |
778 |
gchar *key; |
779 |
char *sub_key; |
780 |
- gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
781 |
struct_hist_div *shd; |
782 |
|
783 |
- div_number_str = utils_str_itoa ( div_number ); |
784 |
- if ( account_number == 0 ) |
785 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
786 |
- else |
787 |
- { |
788 |
- account_number_str = utils_str_itoa ( account_number ); |
789 |
- key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
790 |
- g_free ( account_number_str ); |
791 |
- } |
792 |
- g_free ( div_number_str ); |
793 |
+ key = bet_data_get_key ( account_number, div_number ); |
794 |
|
795 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
796 |
{ |
797 |
@@ -436,20 +407,10 @@ gboolean bet_data_search_div_hist ( gint account_number, gint div_number, gint s |
798 |
{ |
799 |
gchar *key; |
800 |
gchar *sub_key; |
801 |
- gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
802 |
gint origin; |
803 |
struct_hist_div *shd; |
804 |
|
805 |
- div_number_str = utils_str_itoa ( div_number ); |
806 |
- if ( account_number == 0 ) |
807 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
808 |
- else |
809 |
- { |
810 |
- account_number_str = utils_str_itoa ( account_number ); |
811 |
- key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
812 |
- g_free ( account_number_str ); |
813 |
- } |
814 |
- g_free ( div_number_str ); |
815 |
+ key = bet_data_get_key ( account_number, div_number ); |
816 |
|
817 |
origin = gsb_data_account_get_bet_hist_data ( account_number ); |
818 |
|
819 |
@@ -563,21 +524,11 @@ gchar *bet_data_get_div_name ( gint div_num, |
820 |
gboolean bet_data_get_div_edited ( gint account_number, gint div_number, gint sub_div_nb ) |
821 |
{ |
822 |
gchar *key; |
823 |
- gchar *div_number_str, *account_number_str; // only to avoid memory leaks |
824 |
gint origin; |
825 |
struct_hist_div *shd; |
826 |
gboolean edited; |
827 |
|
828 |
- div_number_str = utils_str_itoa ( div_number ); |
829 |
- if ( account_number == 0 ) |
830 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
831 |
- else |
832 |
- { |
833 |
- account_number_str = utils_str_itoa ( account_number ); |
834 |
- key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
835 |
- g_free ( account_number_str ); |
836 |
- } |
837 |
- g_free ( div_number_str ); |
838 |
+ key = bet_data_get_key ( account_number, div_number ); |
839 |
|
840 |
origin = gsb_data_account_get_bet_hist_data ( account_number ); |
841 |
|
842 |
@@ -619,19 +570,9 @@ gboolean bet_data_set_div_edited ( gint account_nb, |
843 |
gboolean edited ) |
844 |
{ |
845 |
gchar *key; |
846 |
- gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
847 |
struct_hist_div *shd; |
848 |
|
849 |
- div_number_str = utils_str_itoa ( div_number ); |
850 |
- if ( account_nb == 0 ) |
851 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
852 |
- else |
853 |
- { |
854 |
- account_nb_str = utils_str_itoa ( account_nb ); |
855 |
- key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
856 |
- g_free ( account_nb_str ); |
857 |
- } |
858 |
- g_free ( div_number_str ); |
859 |
+ key = bet_data_get_key ( account_nb, div_number ); |
860 |
|
861 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
862 |
{ |
863 |
@@ -664,20 +605,10 @@ gboolean bet_data_set_div_edited ( gint account_nb, |
864 |
gsb_real bet_data_hist_get_div_amount ( gint account_nb, gint div_number, gint sub_div_nb ) |
865 |
{ |
866 |
gchar *key; |
867 |
- gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
868 |
struct_hist_div *shd; |
869 |
gsb_real amount; |
870 |
|
871 |
- div_number_str = utils_str_itoa ( div_number ); |
872 |
- if ( account_nb == 0 ) |
873 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
874 |
- else |
875 |
- { |
876 |
- account_nb_str = utils_str_itoa ( account_nb ); |
877 |
- key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
878 |
- g_free ( account_nb_str ); |
879 |
- } |
880 |
- g_free ( div_number_str ); |
881 |
+ key = bet_data_get_key ( account_nb, div_number ); |
882 |
|
883 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
884 |
{ |
885 |
@@ -716,19 +647,9 @@ gboolean bet_data_set_div_amount ( gint account_nb, |
886 |
gsb_real amount ) |
887 |
{ |
888 |
gchar *key; |
889 |
- gchar *div_number_str, *account_nb_str; // only to avoid memory leaks |
890 |
struct_hist_div *shd; |
891 |
|
892 |
- div_number_str = utils_str_itoa ( div_number ); |
893 |
- if ( account_nb == 0 ) |
894 |
- key = g_strconcat ("0:", div_number_str, NULL ); |
895 |
- else |
896 |
- { |
897 |
- account_nb_str = utils_str_itoa ( account_nb ); |
898 |
- key = g_strconcat ( account_nb_str, ":", div_number_str, NULL ); |
899 |
- g_free ( account_nb_str ); |
900 |
- } |
901 |
- g_free ( div_number_str ); |
902 |
+ key = bet_data_get_key ( account_nb, div_number ); |
903 |
|
904 |
if ( ( shd = g_hash_table_lookup ( bet_hist_div_list, key ) ) ) |
905 |
{ |
906 |
@@ -1215,22 +1136,12 @@ void struct_free_bet_future ( struct_futur_data *scheduled ) |
907 |
gboolean bet_data_future_add_lines ( struct_futur_data *scheduled ) |
908 |
{ |
909 |
gchar *key; |
910 |
- gchar *future_number_str, *account_nb_str; // only to avoid memory leaks |
911 |
|
912 |
future_number ++; |
913 |
|
914 |
if ( scheduled -> frequency == 0 ) |
915 |
{ |
916 |
- future_number_str = utils_str_itoa ( future_number ); |
917 |
- if ( scheduled -> account_number == 0 ) |
918 |
- key = g_strconcat ("0:", future_number_str, NULL ); |
919 |
- else |
920 |
- { |
921 |
- account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
922 |
- key = g_strconcat ( account_nb_str, ":", future_number_str, NULL ); |
923 |
- g_free ( account_nb_str ); |
924 |
- } |
925 |
- g_free ( future_number_str ); |
926 |
+ key = bet_data_get_key ( scheduled -> account_number, future_number ); |
927 |
|
928 |
scheduled -> number = future_number; |
929 |
g_hash_table_insert ( bet_future_list, key, scheduled ); |
930 |
@@ -1250,16 +1161,7 @@ gboolean bet_data_future_add_lines ( struct_futur_data *scheduled ) |
931 |
date = gsb_date_copy ( scheduled -> date ); |
932 |
while ( date != NULL && g_date_valid ( date ) ) |
933 |
{ |
934 |
- future_number_str = utils_str_itoa ( future_number ); |
935 |
- if ( scheduled -> account_number == 0 ) |
936 |
- key = g_strconcat ("0:", utils_str_itoa ( future_number ), NULL ); |
937 |
- else |
938 |
- { |
939 |
- account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
940 |
- key = g_strconcat ( account_nb_str, ":", future_number_str, NULL ); |
941 |
- g_free ( account_nb_str ); |
942 |
- } |
943 |
- g_free ( future_number_str ); |
944 |
+ key = bet_data_get_key ( scheduled -> account_number, future_number ); |
945 |
|
946 |
if ( mother_row == future_number ) |
947 |
new_sch = scheduled; |
948 |
@@ -1295,18 +1197,8 @@ gboolean bet_data_future_add_lines ( struct_futur_data *scheduled ) |
949 |
gboolean bet_data_future_set_lines_from_file ( struct_futur_data *scheduled ) |
950 |
{ |
951 |
gchar *key; |
952 |
- gchar *number_str, *account_nb_str; // only to avoid memory leaks |
953 |
|
954 |
- number_str = utils_str_itoa ( scheduled -> number ); |
955 |
- if ( scheduled -> account_number == 0 ) |
956 |
- key = g_strconcat ("0:", number_str, NULL ); |
957 |
- else |
958 |
- { |
959 |
- account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
960 |
- key = g_strconcat ( account_nb_str, ":", number_str, NULL ); |
961 |
- g_free ( account_nb_str ); |
962 |
- } |
963 |
- g_free ( number_str ); |
964 |
+ key = bet_data_get_key ( scheduled -> account_number, scheduled -> number ); |
965 |
|
966 |
bet_data_future_set_max_number ( scheduled -> number ); |
967 |
|
968 |
@@ -1622,18 +1514,8 @@ GDate *bet_data_array_get_date_max ( gint account_number ) |
969 |
gboolean bet_data_future_modify_lines ( struct_futur_data *scheduled ) |
970 |
{ |
971 |
gchar *key; |
972 |
- gchar *number_str, *account_nb_str; // only to avoid memory leaks |
973 |
|
974 |
- number_str = utils_str_itoa ( scheduled -> number ); |
975 |
- if ( scheduled -> account_number == 0 ) |
976 |
- key = g_strconcat ("0:", number_str, NULL ); |
977 |
- else |
978 |
- { |
979 |
- account_nb_str = utils_str_itoa ( scheduled -> account_number ); |
980 |
- key = g_strconcat ( account_nb_str, ":", number_str, NULL ); |
981 |
- g_free ( account_nb_str ); |
982 |
- } |
983 |
- g_free ( number_str ); |
984 |
+ key = bet_data_get_key ( scheduled -> account_number, scheduled -> number ); |
985 |
|
986 |
g_hash_table_replace ( bet_future_list, key, scheduled ); |
987 |
|
988 |
@@ -1653,19 +1535,9 @@ gboolean bet_data_future_modify_lines ( struct_futur_data *scheduled ) |
989 |
struct_futur_data *bet_data_future_get_struct ( gint account_number, gint number ) |
990 |
{ |
991 |
gchar *key; |
992 |
- gchar *number_str, *account_nb_str; // only to avoid memory leaks |
993 |
struct_futur_data *scheduled; |
994 |
|
995 |
- number_str = utils_str_itoa ( number ); |
996 |
- if ( scheduled -> account_number == 0 ) |
997 |
- key = g_strconcat ("0:", number_str, NULL ); |
998 |
- else |
999 |
- { |
1000 |
- account_nb_str = utils_str_itoa ( account_number ); |
1001 |
- key = g_strconcat ( account_nb_str, ":", number_str, NULL ); |
1002 |
- g_free ( account_nb_str ); |
1003 |
- } |
1004 |
- g_free ( number_str ); |
1005 |
+ key = bet_data_get_key ( account_number, number ); |
1006 |
|
1007 |
if ( ( scheduled = g_hash_table_lookup ( bet_future_list, key ) ) ) |
1008 |
return scheduled; |
1009 |
@@ -1728,20 +1600,10 @@ GHashTable *bet_data_transfert_get_list ( void ) |
1010 |
gboolean bet_data_transfert_add_line ( struct_transfert_data *transfert ) |
1011 |
{ |
1012 |
gchar *key; |
1013 |
- gchar *transfert_nb_str, *account_nb_str; // only to avoid memory leaks |
1014 |
|
1015 |
transfert_number ++; |
1016 |
|
1017 |
- transfert_nb_str = utils_str_itoa ( transfert_number ); |
1018 |
- if ( transfert -> account_number == 0 ) |
1019 |
- key = g_strconcat ("0:", transfert_nb_str, NULL ); |
1020 |
- else |
1021 |
- { |
1022 |
- account_nb_str = utils_str_itoa ( transfert -> account_number ); |
1023 |
- key = g_strconcat ( account_nb_str, ":", transfert_nb_str, NULL ); |
1024 |
- g_free ( account_nb_str ); |
1025 |
- } |
1026 |
- g_free ( transfert_nb_str ); |
1027 |
+ key = bet_data_get_key ( transfert -> account_number, transfert_number ); |
1028 |
|
1029 |
transfert -> number = transfert_number; |
1030 |
g_hash_table_insert ( bet_transfert_list, key, transfert ); |
1031 |
@@ -1798,18 +1660,8 @@ gboolean bet_data_transfert_remove_line ( gint account_number, gint number ) |
1032 |
gboolean bet_data_transfert_set_line_from_file ( struct_transfert_data *transfert ) |
1033 |
{ |
1034 |
gchar *key; |
1035 |
- gchar *transfert_nb_str, *account_nb_str; // only to avoid memory leaks |
1036 |
|
1037 |
- transfert_nb_str = utils_str_itoa ( transfert -> number ); |
1038 |
- if ( transfert -> account_number == 0 ) |
1039 |
- key = g_strconcat ("0:", transfert_nb_str, NULL ); |
1040 |
- else |
1041 |
- { |
1042 |
- account_nb_str = utils_str_itoa ( transfert -> account_number ); |
1043 |
- key = g_strconcat ( account_nb_str, ":", transfert_nb_str, NULL ); |
1044 |
- g_free ( account_nb_str ); |
1045 |
- } |
1046 |
- g_free ( transfert_nb_str ); |
1047 |
+ key = bet_data_get_key ( transfert -> account_number, transfert -> number ); |
1048 |
|
1049 |
if ( transfert -> number > transfert_number ) |
1050 |
transfert_number = transfert -> number; |
1051 |
@@ -1829,18 +1681,8 @@ gboolean bet_data_transfert_set_line_from_file ( struct_transfert_data *transfer |
1052 |
gboolean bet_data_transfert_modify_line ( struct_transfert_data *transfert ) |
1053 |
{ |
1054 |
gchar *key; |
1055 |
- gchar *transfert_nb_str, *account_nb_str; // only to avoid memory leaks |
1056 |
|
1057 |
- transfert_nb_str = utils_str_itoa ( transfert -> number ); |
1058 |
- if ( transfert -> account_number == 0 ) |
1059 |
- key = g_strconcat ("0:", transfert_nb_str, NULL ); |
1060 |
- else |
1061 |
- { |
1062 |
- account_nb_str = utils_str_itoa ( transfert -> account_number ); |
1063 |
- key = g_strconcat ( account_nb_str, ":", transfert_nb_str, NULL ); |
1064 |
- g_free ( account_nb_str ); |
1065 |
- } |
1066 |
- g_free ( transfert_nb_str ); |
1067 |
+ key = bet_data_get_key ( transfert -> account_number, transfert -> number ); |
1068 |
|
1069 |
g_hash_table_replace ( bet_transfert_list, key, transfert ); |
1070 |
|
1071 |
@@ -1962,6 +1804,35 @@ gboolean bet_data_remove_all_bet_data ( gint account_number ) |
1072 |
} |
1073 |
|
1074 |
|
1075 |
+/** |
1076 |
+ * retourne la clef de recherche de la division passée en paramètre. |
1077 |
+ * |
1078 |
+ * |
1079 |
+ * |
1080 |
+ * */ |
1081 |
+gchar *bet_data_get_key ( gint account_number, gint div_number ) |
1082 |
+{ |
1083 |
+ gchar *key; |
1084 |
+ gchar *div_number_str, *account_number_str; /* only to avoid memory leaks */ |
1085 |
+ |
1086 |
+ div_number_str = utils_str_itoa ( div_number ); |
1087 |
+ |
1088 |
+ if ( account_number == 0 ) |
1089 |
+ key = g_strconcat ("0:", div_number_str, NULL ); |
1090 |
+ else |
1091 |
+ { |
1092 |
+ account_number_str = utils_str_itoa ( account_number ); |
1093 |
+ key = g_strconcat ( account_number_str, ":", div_number_str, NULL ); |
1094 |
+ |
1095 |
+ g_free ( account_number_str ); |
1096 |
+ } |
1097 |
+ |
1098 |
+ g_free ( div_number_str ); |
1099 |
+ |
1100 |
+ return key; |
1101 |
+} |
1102 |
+ |
1103 |
+ |
1104 |
/* Local Variables: */ |
1105 |
/* c-basic-offset: 4 */ |
1106 |
/* End: */ |
1107 |
-- |
1108 |
1.7.4 |
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
1.1 app-office/grisbi/files/0.8.2-0002-fixes-a-crash-when-importing-a-file-without-extensio.patch |
1114 |
|
1115 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0002-fixes-a-crash-when-importing-a-file-without-extensio.patch?rev=1.1&view=markup |
1116 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0002-fixes-a-crash-when-importing-a-file-without-extensio.patch?rev=1.1&content-type=text/plain |
1117 |
|
1118 |
Index: 0.8.2-0002-fixes-a-crash-when-importing-a-file-without-extensio.patch |
1119 |
=================================================================== |
1120 |
From 3aeefce5f46ae6989cc6a9c2569af895a9a00659 Mon Sep 17 00:00:00 2001 |
1121 |
From: pbiava <pierre.biava@×××××.net> |
1122 |
Date: Thu, 24 Feb 2011 23:07:02 +0100 |
1123 |
Subject: [PATCH 2/5] fixes a crash when importing a file without extension |
1124 |
|
1125 |
--- |
1126 |
src/import.c | 2 +- |
1127 |
1 files changed, 1 insertions(+), 1 deletions(-) |
1128 |
|
1129 |
diff --git a/src/import.c b/src/import.c |
1130 |
index 44802bf..1d5ceeb 100644 |
1131 |
--- a/src/import.c |
1132 |
+++ b/src/import.c |
1133 |
@@ -681,7 +681,7 @@ gboolean import_select_file ( GtkWidget * button, GtkWidget * assistant ) |
1134 |
extension = strrchr ( iterator -> data, '.' ); |
1135 |
|
1136 |
/* unzip Gnucash file if necessary */ |
1137 |
- if ( strcmp ( extension, ".gnc" ) == 0 ) |
1138 |
+ if ( extension && strcmp ( extension, ".gnc" ) == 0 ) |
1139 |
gsb_import_gunzip_file ( iterator -> data ); |
1140 |
|
1141 |
/* get contents of file */ |
1142 |
-- |
1143 |
1.7.4 |
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
1.1 app-office/grisbi/files/0.8.2-0003-fixes-bug-1293-Problem-of-updating-of-the-pointing-b.patch |
1149 |
|
1150 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0003-fixes-bug-1293-Problem-of-updating-of-the-pointing-b.patch?rev=1.1&view=markup |
1151 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0003-fixes-bug-1293-Problem-of-updating-of-the-pointing-b.patch?rev=1.1&content-type=text/plain |
1152 |
|
1153 |
Index: 0.8.2-0003-fixes-bug-1293-Problem-of-updating-of-the-pointing-b.patch |
1154 |
=================================================================== |
1155 |
From 63b110a42e88e2b06c0ff432df0282db395cef17 Mon Sep 17 00:00:00 2001 |
1156 |
From: pbiava <pierre.biava@×××××.net> |
1157 |
Date: Fri, 25 Feb 2011 20:56:03 +0100 |
1158 |
Subject: [PATCH 3/5] fixes bug 1293 : Problem of updating of the pointing balance |
1159 |
|
1160 |
--- |
1161 |
src/gsb_form.c | 8 +++++++- |
1162 |
1 files changed, 7 insertions(+), 1 deletions(-) |
1163 |
|
1164 |
diff --git a/src/gsb_form.c b/src/gsb_form.c |
1165 |
index fc81b59..e66c7c2 100644 |
1166 |
--- a/src/gsb_form.c |
1167 |
+++ b/src/gsb_form.c |
1168 |
@@ -105,6 +105,7 @@ static gboolean gsb_form_validate_form_transaction ( gint transaction_number, |
1169 |
|
1170 |
/*START_EXTERN*/ |
1171 |
extern GdkColor calendar_entry_color; |
1172 |
+extern gint mise_a_jour_liste_comptes_accueil; |
1173 |
extern GtkWidget *navigation_tree_view; |
1174 |
extern gsb_real null_real; |
1175 |
extern GtkWidget *window; |
1176 |
@@ -2660,7 +2661,12 @@ gboolean gsb_form_finish_edition ( void ) |
1177 |
if ( is_transaction ) |
1178 |
{ |
1179 |
affiche_dialogue_soldes_minimaux (); |
1180 |
- update_transaction_in_trees (transaction_number); |
1181 |
+ update_transaction_in_trees ( transaction_number ); |
1182 |
+ if ( gsb_data_transaction_get_marked_transaction ( transaction_number ) == OPERATION_POINTEE ) |
1183 |
+ { |
1184 |
+ gsb_navigation_update_statement_label ( account_number ); |
1185 |
+ mise_a_jour_liste_comptes_accueil = 1; |
1186 |
+ } |
1187 |
} |
1188 |
|
1189 |
/* as we modify or create a transaction, we invalidate the current report */ |
1190 |
-- |
1191 |
1.7.4 |
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
1.1 app-office/grisbi/files/0.8.2-0001-fixes-bug-1289.patch |
1197 |
|
1198 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0001-fixes-bug-1289.patch?rev=1.1&view=markup |
1199 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/grisbi/files/0.8.2-0001-fixes-bug-1289.patch?rev=1.1&content-type=text/plain |
1200 |
|
1201 |
Index: 0.8.2-0001-fixes-bug-1289.patch |
1202 |
=================================================================== |
1203 |
From 3af09ff549167fd9de721f1434422faa9969645d Mon Sep 17 00:00:00 2001 |
1204 |
From: pbiava <pierre.biava@×××××.net> |
1205 |
Date: Wed, 23 Feb 2011 20:34:30 +0100 |
1206 |
Subject: [PATCH 1/5] fixes bug 1289 |
1207 |
|
1208 |
--- |
1209 |
src/etats_config.c | 2 +- |
1210 |
1 files changed, 1 insertions(+), 1 deletions(-) |
1211 |
|
1212 |
diff --git a/src/etats_config.c b/src/etats_config.c |
1213 |
index 9db2da3..9bf8e7d 100644 |
1214 |
--- a/src/etats_config.c |
1215 |
+++ b/src/etats_config.c |
1216 |
@@ -5576,7 +5576,7 @@ GtkWidget *cree_ligne_comparaison_montant ( gint amount_comparison_number ) |
1217 |
|
1218 |
/* on crée alors le bouton de lien */ |
1219 |
|
1220 |
- widget = cree_bouton_lien ( widget ); |
1221 |
+ widget = cree_bouton_lien ( widget_1 ); |
1222 |
gtk_box_pack_start ( GTK_BOX ( hbox ), |
1223 |
widget, |
1224 |
FALSE, |
1225 |
-- |
1226 |
1.7.4 |