[grisbi-cvs] grisbi/src Makefile.am, 1.162, 1.163 balance_estimate_config.c, 1.6, 1.7 balance_estimate_data.c, 1.3, 1.4 balance_estimate_data.h, 1.2, 1.3 balance_estimate_tab.c, 1.40, 1.41 balance_estimate_tab.h, 1.7, 1.8 categories_onglet.c, 1.202, 1.203 etats_calculs.c, 1.134, 1.135 etats_config.c, 1.175, 1.176 etats_onglet.c, 1.136, 1.137 fenetre_principale.c, 1.122, 1.123 gsb_category.c, 1.22, 1.23 gsb_data_archive.c, 1.15, 1.16 gsb_data_budget.c, 1.54, 1.55 gsb_data_category.c, 1.71, 1.72 gsb_data_fyear.c, 1.21, 1.22 gsb_data_payee.c, 1.50, 1.51 gsb_data_payment.c, 1.14, 1.15 gsb_file_save.c, 1.148, 1.149 gsb_select_icon.c, 1.15, 1.16 imputation_budgetaire.c, 1.163, 1.164 metatree.c, 1.145, 1.146 print_dialog_config.c, 1.9, 1.10 print_report.c, 1.10, 1.11 print_transactions_list.c, 1.13, 1.14 tiers_onglet.c, 1.170, 1.171 traitement_variables.c, 1.185, 1.186 utils_str.c, 1.81, 1.82 utils_str.h, 1.46, 1.47
Pierre Biava
pbiava at users.sourceforge.net
Sun Feb 14 18:48:53 CET 2010
Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv654/src
Modified Files:
Makefile.am balance_estimate_config.c balance_estimate_data.c
balance_estimate_data.h balance_estimate_tab.c
balance_estimate_tab.h categories_onglet.c etats_calculs.c
etats_config.c etats_onglet.c fenetre_principale.c
gsb_category.c gsb_data_archive.c gsb_data_budget.c
gsb_data_category.c gsb_data_fyear.c gsb_data_payee.c
gsb_data_payment.c gsb_file_save.c gsb_select_icon.c
imputation_budgetaire.c metatree.c print_dialog_config.c
print_report.c print_transactions_list.c tiers_onglet.c
traitement_variables.c utils_str.c utils_str.h
Log Message:
deletion of the g_strcasecmp () function and minor changes
Index: etats_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_config.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -d -r1.175 -r1.176
--- etats_config.c 10 Jan 2010 20:11:37 -0000 1.175
+++ etats_config.c 14 Feb 2010 17:48:49 -0000 1.176
@@ -7376,8 +7376,7 @@
}
/* sort and set that list in the clist and associate the name to the row */
- liste_nom_types = g_slist_sort ( liste_nom_types,
- (GCompareFunc) gsb_strcasecmp );
+ liste_nom_types = g_slist_sort ( liste_nom_types, (GCompareFunc) my_strcasecmp );
list_tmp = liste_nom_types;
Index: metatree.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/metatree.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- metatree.c 13 Feb 2010 17:44:59 -0000 1.145
+++ metatree.c 14 Feb 2010 17:48:50 -0000 1.146
@@ -53,6 +53,7 @@
/*START_STATIC*/
+static void button_delete_div_sub_div_clicked ( GtkWidget *togglebutton, GtkWidget *button );
static gboolean division_node_maybe_expand ( GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer data );
static void fill_division_zero ( GtkTreeModel * model,
@@ -122,6 +123,8 @@
extern GtkTreeModel * navigation_model;
/*END_EXTERN*/
+/* Save the choice for the deleting of division */
+gint button_move_selected = 0;
/**
* Determine whether a model is displayed. That is, in metatree's
@@ -1844,18 +1847,34 @@
else
tmpstr = g_strdup_printf(_("Just remove this sub-%s."), _(iface -> meta_name) );
- button_delete = gtk_radio_button_new_with_label ( gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( button_move )), tmpstr );
+ button_delete = gtk_radio_button_new_with_label (
+ gtk_radio_button_get_group ( GTK_RADIO_BUTTON ( button_move ) ),
+ tmpstr );
g_free ( tmpstr );
gtk_box_pack_start ( GTK_BOX ( hbox ), button_delete, FALSE, FALSE, 0 );
+ if ( button_move_selected == 1 )
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( button_delete ), TRUE );
+
+ /* set the signals */
+ g_signal_connect ( G_OBJECT ( button_move ),
+ "released",
+ G_CALLBACK ( button_delete_div_sub_div_clicked ),
+ NULL );
+
+ g_signal_connect ( G_OBJECT ( button_delete ),
+ "released",
+ G_CALLBACK ( button_delete_div_sub_div_clicked ),
+ NULL );
+
gtk_widget_show_all ( dialog );
resultat = gtk_dialog_run ( GTK_DIALOG ( dialog ) );
if ( resultat != GTK_RESPONSE_OK )
{
- gtk_widget_destroy ( GTK_WIDGET ( dialog ) );
- return FALSE;
+ gtk_widget_destroy ( GTK_WIDGET ( dialog ) );
+ return FALSE;
}
nouveau_no_division = 0;
@@ -1907,7 +1926,6 @@
}
-
/**
* Find transactions that are associated with a div or subdiv.
*
@@ -2720,6 +2738,22 @@
if ( etat.modification_fichier == 0 )
modification_fichier ( TRUE );
}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+static void button_delete_div_sub_div_clicked ( GtkWidget *togglebutton, GtkWidget *button )
+{
+ button_move_selected = gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON ( togglebutton ) );
+ gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON ( togglebutton ),
+ button_move_selected );
+}
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: gsb_file_save.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_save.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- gsb_file_save.c 31 Jan 2010 20:47:24 -0000 1.148
+++ gsb_file_save.c 14 Feb 2010 17:48:50 -0000 1.149
@@ -543,7 +543,10 @@
* */
const gchar *my_safe_null_str ( const gchar *string )
{
- return string ? string : "(null)";
+ if ( string && strlen ( string ) )
+ return string;
+ else
+ return "(null)";
}
Index: print_transactions_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/print_transactions_list.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- print_transactions_list.c 29 Aug 2009 08:36:41 -0000 1.13
+++ print_transactions_list.c 14 Feb 2010 17:48:50 -0000 1.14
@@ -42,7 +42,7 @@
#include "./erreur.h"
/*END_INCLUDE*/
-#if GTK_CHECK_VERSION(2,10,0)
+#if GTK_CHECK_VERSION(2,12,0)
/*START_STATIC*/
static gboolean print_transactions_list_apply ( GtkPrintOperation * operation,
@@ -908,7 +908,7 @@
return line_position;
}
-#endif /* GTK_CHECK_VERSION(2,10,0) */
+#endif /* GTK_CHECK_VERSION(2,12,0) */
Index: categories_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/categories_onglet.c,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -d -r1.202 -r1.203
--- categories_onglet.c 22 Nov 2009 18:45:52 -0000 1.202
+++ categories_onglet.c 14 Feb 2010 17:48:49 -0000 1.203
@@ -143,9 +143,6 @@
"text", META_TREE_TEXT_COLUMN,
"weight", META_TREE_FONT_COLUMN,
NULL);
-#if GTK_CHECK_VERSION(2,4,0)
- gtk_tree_view_column_set_expand ( column, TRUE );
-#endif
gtk_tree_view_append_column ( GTK_TREE_VIEW ( arbre_categ ),
GTK_TREE_VIEW_COLUMN ( column ) );
Index: gsb_data_payment.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_payment.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gsb_data_payment.c 9 Jan 2010 20:57:38 -0000 1.14
+++ gsb_data_payment.c 14 Feb 2010 17:48:50 -0000 1.15
@@ -232,7 +232,7 @@
if ( payment -> account_number == account_number )
{
- if ( (compare = gsb_strcasecmp ( (gchar *)name, payment -> payment_name ) ) == 0 )
+ if ( (compare = my_strcasecmp ( (gchar *)name, payment -> payment_name ) ) == 0 )
return payment -> payment_number;
}
tmp_list = tmp_list -> next;
@@ -623,8 +623,8 @@
struct_payment *payment;
payment = tmp_list -> data;
- if (payment -> account_number == account_number)
- if (!g_strcasecmp (payment -> payment_name, _("Transfer")))
+ if ( payment -> account_number == account_number )
+ if ( !my_strcasecmp (payment -> payment_name, _("Transfer") ) )
return payment -> payment_number;
tmp_list = tmp_list -> next;
Index: tiers_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/tiers_onglet.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -d -r1.170 -r1.171
--- tiers_onglet.c 22 Nov 2009 18:45:52 -0000 1.170
+++ tiers_onglet.c 14 Feb 2010 17:48:50 -0000 1.171
@@ -223,9 +223,6 @@
"text", META_TREE_TEXT_COLUMN,
"weight", META_TREE_FONT_COLUMN,
NULL);
-#if GTK_CHECK_VERSION(2,4,0)
- gtk_tree_view_column_set_expand ( column, TRUE );
-#endif
gtk_tree_view_append_column ( GTK_TREE_VIEW ( payee_tree ),
GTK_TREE_VIEW_COLUMN ( column ) );
Index: gsb_data_budget.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_budget.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- gsb_data_budget.c 22 Nov 2009 18:45:52 -0000 1.54
+++ gsb_data_budget.c 14 Feb 2010 17:48:50 -0000 1.55
@@ -746,8 +746,7 @@
gint gsb_data_budget_get_pointer_from_name_in_glist ( struct_budget *budget,
const gchar *name )
{
- return ( g_strcasecmp ( budget -> budget_name,
- name ));
+ return ( my_strcasecmp ( budget -> budget_name, name ) );
}
@@ -763,8 +762,7 @@
gint gsb_data_budget_get_pointer_from_sub_name_in_glist ( struct_sub_budget *sub_budget,
const gchar *name )
{
- return ( g_strcasecmp ( sub_budget -> sub_budget_name,
- name ));
+ return ( my_strcasecmp ( sub_budget -> sub_budget_name, name ));
}
Index: balance_estimate_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_config.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- balance_estimate_config.c 4 Feb 2010 20:04:51 -0000 1.6
+++ balance_estimate_config.c 14 Feb 2010 17:48:49 -0000 1.7
@@ -29,6 +29,7 @@
/*START_INCLUDE*/
#include "balance_estimate_config.h"
#include "./balance_estimate_data.h"
+#include "./balance_estimate_hist.h"
#include "./balance_estimate_tab.h"
#include "./parametres.h"
#include "./menu.h"
@@ -116,11 +117,11 @@
* */
GtkWidget *bet_config_select_historical_data ( GtkWidget *container )
{
- //~ GtkWidget *widget;
+ GtkWidget *widget;
GtkWidget *hbox;
GtkWidget *button_1, *button_2;
- //~ gchar *str_year;
- //~ gint year;
+ gchar *str_year;
+ gint year;
/* Choix des données sources */
hbox = gtk_hbox_new ( FALSE, 5 );
@@ -136,42 +137,40 @@
gtk_widget_set_name ( button_2, "button_2" );
g_signal_connect (G_OBJECT ( button_2 ),
"released",
- G_CALLBACK ( bet_historical_data_clicked ),
+ G_CALLBACK ( bet_historical_origin_data_clicked ),
NULL );
gtk_box_pack_start ( GTK_BOX ( hbox ), button_1, FALSE, FALSE, 5) ;
gtk_box_pack_start ( GTK_BOX ( hbox ), button_2, FALSE, FALSE, 5) ;
/* création du sélecteur de périod */
- //~ if ( bet_fyear_create_combobox_store ( ) )
- //~ {
- //~ widget = gsb_fyear_make_combobox_new ( bet_fyear_model_filter, TRUE );
- //~ gtk_widget_set_name ( GTK_WIDGET ( widget ), "fyear_combo" );
- //~ gtk_widget_set_tooltip_text ( GTK_WIDGET ( widget ),
- //~ SPACIFY(_("Choose the financial year or 12 months rolling") ) );
- //~ gtk_box_pack_start ( GTK_BOX ( hbox ), widget, FALSE, FALSE, 5);
+ widget = gsb_fyear_make_combobox_new ( bet_fyear_model_filter, TRUE );
+ gtk_widget_set_name ( GTK_WIDGET ( widget ), "fyear_combo" );
+ gtk_widget_set_tooltip_text ( GTK_WIDGET ( widget ),
+ SPACIFY(_("Choose the financial year or 12 months rolling") ) );
+ gtk_box_pack_start ( GTK_BOX ( hbox ), widget, FALSE, FALSE, 5);
- //~ /* hide the present financial year */
- //~ year = g_date_get_year ( gdate_today ( ) );
- //~ str_year = utils_str_itoa ( year );
- //~ gsb_fyear_hide_iter_by_name ( bet_fyear_model, str_year );
- //~ g_free ( str_year );
+ /* hide the present financial year */
+ year = g_date_get_year ( gdate_today ( ) );
+ str_year = utils_str_itoa ( year );
+ gsb_fyear_hide_iter_by_name ( bet_fyear_model, str_year );
+ g_free ( str_year );
- //~ /* show the old choice */
- //~ if ( etat.bet_hist_fyear > 0 )
- //~ {
- //~ gsb_fyear_select_iter_by_number ( widget,
- //~ bet_fyear_model,
- //~ bet_fyear_model_filter,
- //~ etat.bet_hist_fyear );
- //~ }
+ /* show the old choice */
+ if ( etat.bet_hist_fyear > 0 )
+ {
+ gsb_fyear_select_iter_by_number ( widget,
+ bet_fyear_model,
+ bet_fyear_model_filter,
+ etat.bet_hist_fyear );
+ }
+
+ /* set the signal */
+ g_signal_connect ( G_OBJECT ( widget ),
+ "changed",
+ G_CALLBACK (bet_historical_fyear_clicked),
+ NULL );
- //~ /* set the signal */
- //~ g_signal_connect ( G_OBJECT ( widget ),
- //~ "changed",
- //~ G_CALLBACK (bet_historical_fyear_clicked),
- //~ NULL );
- //~ }
return hbox;
}
Index: gsb_category.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_category.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- gsb_category.c 24 Aug 2009 13:31:08 -0000 1.22
+++ gsb_category.c 14 Feb 2010 17:48:50 -0000 1.23
@@ -396,16 +396,16 @@
{
gchar * title = NULL, * description = NULL;
- if ( ! g_strcasecmp ( element_name, "general" ) )
+ if ( ! my_strcasecmp ( element_name, "general" ) )
{
while ( *attribute_names )
{
- if ( ! g_strcasecmp ( *attribute_names, "title" ) )
+ if ( ! my_strcasecmp ( *attribute_names, "title" ) )
{
title = (gchar *) *attribute_values;
}
- if ( ! g_strcasecmp ( *attribute_names, "description" ) )
+ if ( ! my_strcasecmp ( *attribute_names, "description" ) )
{
description = (gchar *) *attribute_values;
}
Index: gsb_data_category.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_category.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- gsb_data_category.c 30 Aug 2009 17:59:47 -0000 1.71
+++ gsb_data_category.c 14 Feb 2010 17:48:50 -0000 1.72
@@ -794,8 +794,7 @@
gint gsb_data_category_get_pointer_from_name_in_glist ( struct_category *category,
const gchar *name )
{
- return ( g_strcasecmp ( category -> category_name,
- name ));
+ return ( my_strcasecmp ( category -> category_name, name ));
}
@@ -815,8 +814,7 @@
||
!name )
return 1;
- return ( g_strcasecmp ( sub_category -> sub_category_name,
- name ));
+ return ( my_strcasecmp ( sub_category -> sub_category_name, name ) );
}
Index: balance_estimate_tab.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- balance_estimate_tab.h 31 Jan 2010 20:47:24 -0000 1.7
+++ balance_estimate_tab.h 14 Feb 2010 17:48:49 -0000 1.8
@@ -26,12 +26,18 @@
/* END_INCLUDE_H */
/* START_DECLARATION */
-GtkWidget *bet_create_balance_estimate_tab ( void );
-void bet_historical_fyear_clicked ( GtkWidget *combo, gpointer data );
+GtkWidget *bet_balance_estimate_create_tab ( void );
gboolean bet_fyear_create_combobox_store ( void );
-void bet_historical_data_clicked ( GtkWidget *togglebutton, gpointer data );
+GtkWidget *bet_parameter_get_list_accounts ( GtkWidget *container );
+gint bet_estimate_get_account_selected ( void );
GtkWidget *bet_parameter_get_duration_widget ( GtkWidget *container, gboolean config );
void bet_update_balance_estimate_tab ( void );
+void bet_estimate_refresh ( void );
+void bet_estimate_tab_add_new_line ( GtkTreeModel *tab_model,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ GDate *date_min,
+ GDate *date_max );
/* END_DECLARATION */
#endif /*_BALANCE_ESTIMATE_TAB_H*/
Index: Makefile.am
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/Makefile.am,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- Makefile.am 31 Jan 2010 20:47:24 -0000 1.162
+++ Makefile.am 14 Feb 2010 17:48:49 -0000 1.163
@@ -147,6 +147,7 @@
utils_str.c \
balance_estimate_config.c \
balance_estimate_data.c \
+ balance_estimate_hist.c \
balance_estimate_tab.c
grisbi_INCLUDES = \
@@ -157,6 +158,7 @@
barre_outils.h \
balance_estimate_config.h \
balance_estimate_data.h \
+ balance_estimate_hist.h \
balance_estimate_tab.h \
categories_onglet.h \
classement_echeances.h \
@@ -306,7 +308,7 @@
if HAVE_CUNIT
grisbi_SOURCES = $(sources) $(sources_config) $(cunit_sources)
else#HAVE_CUNIT
-grisbi_SOURCES = $(sources) $(sources_config)
+grisbi_SOURCES = $(sources) $(sources_config)
endif#HAVE_CUNIT
EXTRA_DIST = grisbi.desktop grisbi.keys grisbi.mime $(grisbi_INCLUDES) $(cunit_sources) $(cunit_includes)
Index: balance_estimate_tab.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_tab.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- balance_estimate_tab.c 8 Feb 2010 22:01:20 -0000 1.40
+++ balance_estimate_tab.c 14 Feb 2010 17:48:49 -0000 1.41
@@ -41,6 +41,7 @@
/*START_INCLUDE*/
#include "balance_estimate_tab.h"
#include "./balance_estimate_data.h"
+#include "./balance_estimate_hist.h"
#include "./utils_dates.h"
#include "./gsb_data_account.h"
#include "./gsb_data_budget.h"
@@ -77,10 +78,6 @@
gpointer user_data );
static void bet_duration_button_clicked ( GtkWidget *togglebutton,
GtkWidget *spin_button );
[...1035 lines suppressed...]
/**
@@ -2540,6 +1650,8 @@
bet_update_average_column, tmp_range );
}
}
+
+
/**
* delete a row
*
@@ -2579,6 +1691,8 @@
bet_update_average_column, tmp_range );
}
}
+
+
/**
*
*
Index: print_dialog_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/print_dialog_config.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- print_dialog_config.c 18 Nov 2009 10:12:06 -0000 1.9
+++ print_dialog_config.c 14 Feb 2010 17:48:50 -0000 1.10
@@ -38,7 +38,7 @@
extern GtkWidget *window;
/*END_EXTERN*/
-#if GTK_CHECK_VERSION(2,10,0)
+#if GTK_CHECK_VERSION(2,12,0)
static GtkPrintSettings *settings = NULL;
@@ -88,4 +88,4 @@
}
-#endif /* GTK_CHECK_VERSION(2,10,0) */
+#endif /* GTK_CHECK_VERSION(2,12,0) */
Index: gsb_data_payee.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_payee.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- gsb_data_payee.c 30 Aug 2009 17:59:47 -0000 1.50
+++ gsb_data_payee.c 14 Feb 2010 17:48:50 -0000 1.51
@@ -376,8 +376,7 @@
gint gsb_data_payee_get_pointer_from_name_in_glist ( struct_payee *payee,
const gchar *name )
{
- return ( g_strcasecmp ( payee -> payee_name,
- name ));
+ return ( my_strcasecmp ( payee -> payee_name, name ) );
}
/**
Index: etats_onglet.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_onglet.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- etats_onglet.c 29 Aug 2009 08:36:41 -0000 1.136
+++ etats_onglet.c 14 Feb 2010 17:48:49 -0000 1.137
@@ -144,7 +144,6 @@
gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_exporter_etat, FALSE, FALSE, 0 );
/* print button */
-#if GTK_CHECK_VERSION(2,10,0)
bouton_imprimer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
GTK_STOCK_PRINT,
_("Print"),
@@ -153,13 +152,6 @@
gtk_widget_set_tooltip_text ( GTK_WIDGET (bouton_imprimer_etat),
SPACIFY(_("Print selected report")));
-#else
- bouton_imprimer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
- GTK_STOCK_PRINT,
- _("Print"),
- G_CALLBACK (impression_etat_courant),
- NULL );
-#endif /* GTK_CHECK_VERSION(2,10,0) */
gtk_box_pack_start ( GTK_BOX ( hbox2 ), bouton_imprimer_etat, FALSE, FALSE, 0 );
bouton_effacer_etat = gsb_automem_stock_button_new ( etat.display_toolbar,
Index: imputation_budgetaire.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/imputation_budgetaire.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- imputation_budgetaire.c 22 Nov 2009 18:45:52 -0000 1.163
+++ imputation_budgetaire.c 14 Feb 2010 17:48:50 -0000 1.164
@@ -156,9 +156,6 @@
"text", META_TREE_TEXT_COLUMN,
"weight", META_TREE_FONT_COLUMN,
NULL);
-#if GTK_CHECK_VERSION(2,4,0)
- gtk_tree_view_column_set_expand ( column, TRUE );
-#endif
gtk_tree_view_append_column ( GTK_TREE_VIEW ( budgetary_line_tree ),
GTK_TREE_VIEW_COLUMN ( column ) );
Index: gsb_select_icon.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_select_icon.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gsb_select_icon.c 24 Aug 2009 13:56:59 -0000 1.15
+++ gsb_select_icon.c 14 Feb 2010 17:48:50 -0000 1.16
@@ -266,7 +266,7 @@
{
liste = g_slist_append ( liste, g_strdup ( name ) );
}
- liste = g_slist_sort ( liste, (GCompareFunc) gsb_strcasecmp );
+ liste = g_slist_sort ( liste, (GCompareFunc) my_strcasecmp );
store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
while ( liste )
{
Index: balance_estimate_data.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_data.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- balance_estimate_data.h 31 Jan 2010 20:47:24 -0000 1.2
+++ balance_estimate_data.h 14 Feb 2010 17:48:49 -0000 1.3
@@ -31,9 +31,19 @@
/* START_DECLARATION */
+gint bet_data_add_div_hist ( gint account_nb,
+ gint div_number,
+ gint sub_div_nb,
+ gsb_real moyenne );
+gint bet_data_add_div_hist_at_position ( gint account_nb,
+ gint div_number,
+ gint sub_div_nb,
+ gsb_real moyenne,
+ gint pos );
gchar *bet_data_get_div_name (gint div_num,
gint sub_div,
const gchar *return_value_error );
+gboolean bet_data_init_variables ( void );
gboolean bet_data_populate_div ( gint transaction_number,
GHashTable *list_div );
gboolean bet_data_set_div_ptr ( gint type_div );
Index: etats_calculs.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/etats_calculs.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- etats_calculs.c 7 Feb 2010 20:04:16 -0000 1.134
+++ etats_calculs.c 14 Feb 2010 17:48:49 -0000 1.135
@@ -1818,7 +1818,7 @@
!gsb_data_transaction_get_party_number ( transaction_number_2))
return_value = gsb_data_transaction_get_party_number ( transaction_number_2)- gsb_data_transaction_get_party_number ( transaction_number_1);
else
- return_value = g_strcasecmp ( gsb_data_payee_get_name ( gsb_data_transaction_get_party_number ( transaction_number_1), TRUE ),
+ return_value = my_strcasecmp ( gsb_data_payee_get_name ( gsb_data_transaction_get_party_number ( transaction_number_1), TRUE ),
gsb_data_payee_get_name ( gsb_data_transaction_get_party_number ( transaction_number_2), TRUE ));
break;
@@ -1838,7 +1838,7 @@
!gsb_data_transaction_get_sub_category_number ( transaction_number_2)))
return_value = gsb_data_transaction_get_sub_category_number ( transaction_number_2)- gsb_data_transaction_get_sub_category_number ( transaction_number_1);
else
- return_value = g_strcasecmp ( gsb_data_category_get_name ( gsb_data_transaction_get_category_number ( transaction_number_1),
+ return_value = my_strcasecmp ( gsb_data_category_get_name ( gsb_data_transaction_get_category_number ( transaction_number_1),
gsb_data_transaction_get_sub_category_number ( transaction_number_1),
NULL ),
gsb_data_category_get_name ( gsb_data_transaction_get_category_number ( transaction_number_2),
@@ -1863,7 +1863,7 @@
!gsb_data_transaction_get_sub_budgetary_number ( transaction_number_2)))
return_value = gsb_data_transaction_get_sub_budgetary_number ( transaction_number_2) - gsb_data_transaction_get_sub_budgetary_number ( transaction_number_1);
else
- return_value = g_strcasecmp ( gsb_data_budget_get_name ( gsb_data_transaction_get_budgetary_number ( transaction_number_1),
+ return_value = my_strcasecmp ( gsb_data_budget_get_name ( gsb_data_transaction_get_budgetary_number ( transaction_number_1),
gsb_data_transaction_get_sub_budgetary_number ( transaction_number_1),
NULL ),
gsb_data_budget_get_name ( gsb_data_transaction_get_budgetary_number ( transaction_number_2),
@@ -1878,7 +1878,7 @@
if ( gsb_data_transaction_get_notes ( transaction_number_1)
&&
gsb_data_transaction_get_notes ( transaction_number_2))
- return_value = g_strcasecmp ( gsb_data_transaction_get_notes ( transaction_number_1),
+ return_value = my_strcasecmp ( gsb_data_transaction_get_notes ( transaction_number_1),
gsb_data_transaction_get_notes ( transaction_number_2));
else
return_value = GPOINTER_TO_INT ( gsb_data_transaction_get_notes ( transaction_number_2)) - GPOINTER_TO_INT ( gsb_data_transaction_get_notes ( transaction_number_1));
@@ -1895,7 +1895,7 @@
{
/* les opés peuvent provenir de 2 comptes différents, il faut donc trouver les 2 types dans les */
/* listes différentes */
- return_value = g_strcasecmp ( gsb_data_payment_get_name (gsb_data_transaction_get_method_of_payment_number (transaction_number_1)),
+ return_value = my_strcasecmp ( gsb_data_payment_get_name (gsb_data_transaction_get_method_of_payment_number (transaction_number_1)),
gsb_data_payment_get_name (gsb_data_transaction_get_method_of_payment_number (transaction_number_2)));
}
break;
@@ -1906,7 +1906,7 @@
if ( gsb_data_transaction_get_method_of_payment_content ( transaction_number_1)
&&
gsb_data_transaction_get_method_of_payment_content ( transaction_number_2))
- return_value = g_strcasecmp ( gsb_data_transaction_get_method_of_payment_content ( transaction_number_1),
+ return_value = my_strcasecmp ( gsb_data_transaction_get_method_of_payment_content ( transaction_number_1),
gsb_data_transaction_get_method_of_payment_content ( transaction_number_2));
else
return_value = GPOINTER_TO_INT ( gsb_data_transaction_get_method_of_payment_content ( transaction_number_2)) - GPOINTER_TO_INT ( gsb_data_transaction_get_method_of_payment_content ( transaction_number_1));
@@ -1918,7 +1918,7 @@
if ( gsb_data_transaction_get_voucher ( transaction_number_1)
&&
gsb_data_transaction_get_voucher ( transaction_number_2))
- return_value = g_strcasecmp ( gsb_data_transaction_get_voucher ( transaction_number_1),
+ return_value = my_strcasecmp ( gsb_data_transaction_get_voucher ( transaction_number_1),
gsb_data_transaction_get_voucher ( transaction_number_2));
else
return_value = GPOINTER_TO_INT ( gsb_data_transaction_get_voucher ( transaction_number_2)) - GPOINTER_TO_INT ( gsb_data_transaction_get_voucher ( transaction_number_1));
@@ -1930,7 +1930,7 @@
if ( gsb_data_transaction_get_bank_references ( transaction_number_1)
&&
gsb_data_transaction_get_bank_references ( transaction_number_2))
- return_value = g_strcasecmp ( gsb_data_transaction_get_bank_references ( transaction_number_1),
+ return_value = my_strcasecmp ( gsb_data_transaction_get_bank_references ( transaction_number_1),
gsb_data_transaction_get_bank_references ( transaction_number_2));
else
return_value = GPOINTER_TO_INT ( gsb_data_transaction_get_bank_references ( transaction_number_2)) - GPOINTER_TO_INT ( gsb_data_transaction_get_bank_references ( transaction_number_1));
@@ -1944,7 +1944,7 @@
!gsb_data_transaction_get_reconcile_number ( transaction_number_2))
return_value = gsb_data_transaction_get_reconcile_number ( transaction_number_2)- gsb_data_transaction_get_reconcile_number ( transaction_number_1);
else
- return_value = g_strcasecmp ( gsb_data_reconcile_get_name( gsb_data_transaction_get_reconcile_number ( transaction_number_1)),
+ return_value = my_strcasecmp ( gsb_data_reconcile_get_name( gsb_data_transaction_get_reconcile_number ( transaction_number_1)),
gsb_data_reconcile_get_name ( gsb_data_transaction_get_reconcile_number ( transaction_number_2)));
break;
Index: balance_estimate_data.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/balance_estimate_data.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- balance_estimate_data.c 6 Feb 2010 08:49:46 -0000 1.3
+++ balance_estimate_data.c 14 Feb 2010 17:48:49 -0000 1.4
@@ -28,6 +28,7 @@
/*START_INCLUDE*/
#include "balance_estimate_data.h"
+#include "./dialog.h"
#include "./utils_dates.h"
#include "./gsb_data_account.h"
#include "./gsb_data_budget.h"
@@ -47,12 +48,29 @@
#include "./utils.h"
/*END_INCLUDE*/
+typedef struct _hist_div struct_hist_div;
+
+
+struct _hist_div
+{
+ gint number;
+ gint account_nb;
+ gint div_number;
+ gint sub_div_nb;
+ gsb_real moyenne;
+ gsb_real new_amount;
+};
+
/*START_STATIC*/
static gboolean bet_data_update_div ( SH *sh, gint transaction_number,
gint sub_div );
+static void bet_data_hist_div_list_renumerote ( void );
+static struct_hist_div *initialise_struct_hist_div ( void );
+static void free_struct_hist_div ( struct_hist_div *bet_hist_div );
/*END_STATIC*/
+
/*START_EXTERN*/
extern gboolean balances_with_scheduled;
extern gsb_real null_real;
@@ -65,8 +83,109 @@
gint (*ptr_sub_div) ( gint transaction_num );
gchar* (*ptr_div_name) ( gint div_num, gint sub_div, const gchar *return_value_error );
+
/* liste des div et sub_div cochées dans la vue des divisions */
-static GSList *list_div_hist;
+static GSList *bet_hist_div_list = NULL;
+
+static struct_hist_div *bet_hist_div_buffer;
+
+
+/**
+ * used when we init all the global variables
+ *
+ * \param
+ *
+ * \return FALSE
+ * */
+gboolean bet_data_init_variables ( void )
+{
+ if ( bet_hist_div_list )
+ {
+ GSList* tmp_list = bet_hist_div_list;
+ while ( tmp_list )
+ {
+ struct_hist_div *bet_hist_div;
+
+ bet_hist_div = tmp_list -> data;
+ tmp_list = tmp_list -> next;
+ free_struct_hist_div ( bet_hist_div );
+ }
+ g_slist_free ( bet_hist_div_list );
+ }
+ bet_hist_div_list = NULL;
+ bet_hist_div_buffer = NULL;
+
+ return FALSE;
+
+}
+
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gint bet_data_add_div_hist ( gint account_nb,
+ gint div_number,
+ gint sub_div_nb,
+ gsb_real moyenne )
+{
+ struct_hist_div *bet_hist_div;
+
+ bet_hist_div = g_malloc0 ( sizeof ( struct_hist_div ) );
+ if ( ! bet_hist_div )
+ {
+ dialogue_error_memory ( );
+ return 0;
+ }
+ bet_hist_div -> number = g_slist_length ( bet_hist_div_list ) + 1;
+ bet_hist_div -> account_nb = account_nb;
+ bet_hist_div -> div_number = div_number;
+ bet_hist_div -> sub_div_nb = sub_div_nb;
+ bet_hist_div -> moyenne = moyenne;
+
+ bet_hist_div_list = g_slist_append ( bet_hist_div_list, bet_hist_div );
+
+ bet_hist_div_buffer = bet_hist_div;
+
+ return bet_hist_div -> number;
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+gint bet_data_add_div_hist_at_position ( gint account_nb,
+ gint div_number,
+ gint sub_div_nb,
+ gsb_real moyenne,
+ gint pos )
+{
+ struct_hist_div *bet_hist_div;
+
+ bet_hist_div = initialise_struct_hist_div ( );
+ if ( ! bet_hist_div )
+ {
+ dialogue_error_memory ( );
+ return 0;
+ }
+ bet_hist_div -> account_nb = account_nb;
+ bet_hist_div -> div_number = div_number;
+ bet_hist_div -> sub_div_nb = sub_div_nb;
+ bet_hist_div -> moyenne = moyenne;
+
+ bet_hist_div_list = g_slist_insert ( bet_hist_div_list, bet_hist_div, pos - 1 );
+ bet_data_hist_div_list_renumerote ( );
+
+ bet_hist_div_buffer = bet_hist_div;
+
+ return bet_hist_div -> number;
+}
/**
@@ -174,6 +293,28 @@
/**
+ * renumerote la liste des divisions cochées
+ *
+ * */
+void bet_data_hist_div_list_renumerote ( void )
+{
+ GSList *list_tmp;
+ gint i = 1;
+
+ list_tmp = bet_hist_div_list;
+ while ( list_tmp )
+ {
+ struct_hist_div *bet_hist_div;
+
+ bet_hist_div = list_tmp -> data;
+ bet_hist_div -> number = i;
+ i++;
+ list_tmp = list_tmp -> next;
+ }
+}
+
+
+/**
*
*
*
@@ -232,7 +373,7 @@
*
*
* */
-void free_struct_historical (SH *sh)
+void free_struct_historical ( SH *sh )
{
if ( sh -> sbr )
@@ -249,6 +390,41 @@
*
*
* */
+struct_hist_div *initialise_struct_hist_div ( void )
+{
+ struct_hist_div *bet_hist_div;
+
+ bet_hist_div = g_malloc ( sizeof ( struct_hist_div ) );
+ bet_hist_div -> number = 0;
+ bet_hist_div -> account_nb = 0;
+ bet_hist_div -> div_number = 0;
+ bet_hist_div -> sub_div_nb = 0;
+ bet_hist_div -> moyenne = null_real;
+ bet_hist_div -> new_amount = null_real;
+
+ return bet_hist_div;
+}
+
+
+/**
+ *
+ *
+ *
+ *
+ * */
+void free_struct_hist_div ( struct_hist_div *bet_hist_div )
+{
+ g_free ( bet_hist_div );
+}
+
+/**
+ *
+ *
+ *
+ *
+ * */
+
+
/* Local Variables: */
/* c-basic-offset: 4 */
/* End: */
Index: gsb_data_fyear.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_fyear.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gsb_data_fyear.c 28 Jan 2010 20:25:12 -0000 1.21
+++ gsb_data_fyear.c 14 Feb 2010 17:48:50 -0000 1.22
@@ -290,25 +290,6 @@
}
-
-/**
- * used with g_slist_find_custom to find a fyear in the g_list
- * by his name
- *
- * \param fyear the struct of the current fyear checked
- * \param name the name we are looking for
- *
- * \return 0 if it's the same name
- * */
-/* TODO dOm : this function seems not to be used. Is it possible to remove it
-gint gsb_data_fyear_get_pointer_from_name_in_glist ( struct_fyear *fyear,
- const gchar *name )
-{
- return ( g_strcasecmp ( fyear -> fyear_name,
- name ));
-}
-*/
-
/**
* return the name of the fyear
*
Index: fenetre_principale.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/fenetre_principale.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- fenetre_principale.c 3 Oct 2009 22:14:56 -0000 1.122
+++ fenetre_principale.c 14 Feb 2010 17:48:49 -0000 1.123
@@ -267,13 +267,13 @@
/* append the balance estimate page */
#ifdef ENABLE_BALANCE_ESTIMATE
gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook ),
- bet_create_balance_estimate_tab(),
+ bet_balance_estimate_create_tab (),
gtk_label_new (SPACIFY(_("Balance estimate"))) );
#endif /* ENABLE_BALANCE_ESTIMATE */
/* append the categories page */
gtk_notebook_append_page ( GTK_NOTEBOOK ( notebook ),
- onglet_categories(),
+ onglet_categories (),
gtk_label_new (SPACIFY(_("Categories"))) );
/* append the budget page */
Index: print_report.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/print_report.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- print_report.c 27 Apr 2009 19:41:03 -0000 1.10
+++ print_report.c 14 Feb 2010 17:48:50 -0000 1.11
@@ -37,7 +37,7 @@
#include "./erreur.h"
/*END_INCLUDE*/
-#if GTK_CHECK_VERSION(2,10,0)
+#if GTK_CHECK_VERSION(2,12,0)
/*START_STATIC*/
@@ -485,7 +485,7 @@
-#endif /* GTK_CHECK_VERSION(2,10,0) */
+#endif /* GTK_CHECK_VERSION(2,12,0) */
Index: gsb_data_archive.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_archive.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- gsb_data_archive.c 21 May 2009 21:58:55 -0000 1.15
+++ gsb_data_archive.c 14 Feb 2010 17:48:50 -0000 1.16
@@ -327,24 +327,6 @@
/**
- * used with g_slist_find_custom to find a archive in the g_list
- * by his name
- *
- * \param archive the struct of the current archive checked
- * \param name the name we are looking for
- *
- * \return 0 if it's the same name
- * */
-/* TODO dOm : this function seems not to be used. Is it possible to remove it
-gint gsb_data_archive_get_pointer_from_name_in_glist ( struct_archive *archive,
- const gchar *name )
-{
- return ( g_strcasecmp ( archive -> archive_name,
- name ));
-}
-*/
-
-/**
* return the name of the archive
*
* \param archive_number the number of the archive
Index: traitement_variables.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/traitement_variables.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- traitement_variables.c 31 Jan 2010 20:47:24 -0000 1.185
+++ traitement_variables.c 14 Feb 2010 17:48:50 -0000 1.186
@@ -66,6 +66,7 @@
#include "./gsb_calendar.h"
#include "./erreur.h"
#include "./structures.h"
+#include "./balance_estimate_data.h"
/*END_INCLUDE*/
/*START_STATIC*/
@@ -136,8 +137,7 @@
gchar *adresse_commune = NULL;
gchar *adresse_secondaire = NULL;
-
-
+
/*START_EXTERN*/
extern gint affichage_echeances;
extern gint affichage_echeances_perso_nb_libre;
@@ -376,6 +376,7 @@
categ_tree_model = NULL;
/* initializes the variables for the estimate balance module */
+ bet_data_init_variables ( );
etat.bet_deb_period = 1;
etat.bet_end_period = 1;
etat.bet_spin_range = 0;
Index: utils_str.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_str.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- utils_str.h 13 Feb 2010 20:27:03 -0000 1.46
+++ utils_str.h 14 Feb 2010 17:48:51 -0000 1.47
@@ -5,8 +5,6 @@
/* START_DECLARATION */
-gint gsb_strcasecmp ( gchar *string_1,
- gchar *string_2 );
gchar *gsb_string_extract_int ( const gchar *chaine );
GSList *gsb_string_get_categ_budget_struct_list_from_string ( const gchar *string );
GSList *gsb_string_get_int_list_from_string ( const gchar *string,
Index: utils_str.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_str.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- utils_str.c 13 Feb 2010 20:27:03 -0000 1.81
+++ utils_str.c 14 Feb 2010 17:48:50 -0000 1.82
@@ -388,48 +388,6 @@
/**
- * do the same as g_strcasecmp but works alse with the accents on the words
- *
- * \param string_1 the first string to cmp
- * \param string_2 the second string to cmp
- *
- * \return -1 if string_1 berfore string_2
- * */
-gint gsb_strcasecmp ( gchar *string_1,
- gchar *string_2 )
-{
- gint result;
-
- if (!string_1 && string_2)
- return -1;
- if (string_1 && !string_2)
- return 1;
-
- string_1 = my_strdup ( string_1 );
- string_1 = g_strdelimit ( string_1, "éÃèÃêÃ", 'e' );
- string_1 = g_strdelimit ( string_1, "çÃ", 'c' );
- string_1 = g_strdelimit ( string_1, "Ã Ã", 'a' );
- string_1 = g_strdelimit ( string_1, "ùûÃÃ", 'u' );
- string_1 = g_strdelimit ( string_1, "ôÃ", 'o' );
- string_1 = g_strdelimit ( string_1, "îÃ", 'i' );
-
- string_2 = my_strdup ( string_2 );
- string_2 = g_strdelimit ( string_2, "éÃèÃêÃ", 'e' );
- string_2 = g_strdelimit ( string_2, "çÃ", 'c' );
- string_2 = g_strdelimit ( string_2, "Ã Ã", 'a' );
- string_2 = g_strdelimit ( string_2, "ùûÃÃ", 'u' );
- string_2 = g_strdelimit ( string_2, "ôÃ", 'o' );
- string_2 = g_strdelimit ( string_2, "îÃ", 'i' );
-
- result = g_ascii_strcasecmp ( string_1, string_2 );
- g_free(string_1);
- g_free(string_2);
-
- return result;
-}
-
-
-/**
* compare 2 strings unsensitive
* if a string is NULL, it will go after the non NULL
*
@@ -438,37 +396,34 @@
*
* \return -1 string_1 before string_2 (or string_2 NULL) ; 0 if same or NULL everyone ; +1 if string_1 after string_2 (or string_1 NULL)
* */
-gint my_strcasecmp ( const gchar *string_1,
- const gchar *string_2 )
+gint my_strcasecmp ( const gchar *string_1, const gchar *string_2 )
{
if (!string_1 && string_2)
- return 1;
+ return 1;
if (string_1 && !string_2)
- return -1;
- if ( string_1
- &&
- string_2 )
+ return -1;
+
+ if ( string_1 && string_2 )
{
- if ( g_utf8_validate ( string_1, -1, NULL )
- &&
- g_utf8_validate ( string_2, -1, NULL ))
- {
- gint retour;
- gchar *new_1, *new_2;
-
- new_1 = g_utf8_collate_key ( g_utf8_casefold ( string_1,-1 ),
- -1 );
- new_2 = g_utf8_collate_key ( g_utf8_casefold ( string_2,-1 ),
- -1 );
- retour = strcmp ( new_1,
- new_2 );
- g_free ( new_1 );
- g_free ( new_2 );
- return ( retour );
- }
- else
- return ( g_ascii_strcasecmp ( string_1,
- string_2 ));
+ if ( g_utf8_validate ( string_1, -1, NULL )
+ &&
+ g_utf8_validate ( string_2, -1, NULL ))
+ {
+ gint retour;
+ gchar *new_1, *new_2;
+
+ new_1 = g_utf8_collate_key ( g_utf8_casefold ( string_1,-1 ),
+ -1 );
+ new_2 = g_utf8_collate_key ( g_utf8_casefold ( string_2,-1 ),
+ -1 );
+ retour = strcmp ( new_1,
+ new_2 );
+ g_free ( new_1 );
+ g_free ( new_2 );
+ return ( retour );
+ }
+ else
+ return ( g_ascii_strcasecmp ( string_1, string_2 ) );
}
return 0;
@@ -485,29 +440,30 @@
gchar *string_2,
gint longueur )
{
- if ( string_1
- &&
- string_2 )
+ if (!string_1 && string_2)
+ return 1;
+ if (string_1 && !string_2)
+ return -1;
+
+ if ( string_1 && string_2 )
{
- if ( g_utf8_validate ( string_1, -1, NULL )
- &&
- g_utf8_validate ( string_2, -1, NULL ))
- {
- gint retour;
- gchar *new_1, *new_2;
-
- new_1 = g_utf8_casefold ( string_1,longueur );
- new_2 = g_utf8_casefold ( string_2,longueur );
- retour = g_utf8_collate ( new_1, new_2);
+ if ( g_utf8_validate ( string_1, -1, NULL )
+ &&
+ g_utf8_validate ( string_2, -1, NULL ))
+ {
+ gint retour;
+ gchar *new_1, *new_2;
+
+ new_1 = g_utf8_casefold ( string_1,longueur );
+ new_2 = g_utf8_casefold ( string_2,longueur );
+ retour = g_utf8_collate ( new_1, new_2);
- g_free ( new_1 );
- g_free ( new_2 );
- return ( retour );
- }
- else
- return ( g_ascii_strncasecmp ( string_1,
- string_2,
- longueur ));
+ g_free ( new_1 );
+ g_free ( new_2 );
+ return ( retour );
+ }
+ else
+ return ( g_ascii_strncasecmp ( string_1, string_2, longueur ) );
}
return 0;
More information about the cvs
mailing list