[grisbi-cvs] grisbi/src accueil.c, 1.216, 1.217 affichage.c, 1.167, 1.168 custom_list.c, 1.5, 1.6 gsb_currency.c, 1.41, 1.42 gsb_currency_config.c, 1.60, 1.61 gsb_data_transaction.c, 1.72, 1.73 gsb_data_transaction.h, 1.33, 1.34 gsb_fyear_config.c, 1.23, 1.24 import.c, 1.298, 1.299 utils_str.c, 1.71, 1.72

Pierre Biava pbiava at users.sourceforge.net
Mon Oct 26 23:38:23 CET 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10886/src

Modified Files:
	accueil.c affichage.c custom_list.c gsb_currency.c 
	gsb_currency_config.c gsb_data_transaction.c 
	gsb_data_transaction.h gsb_fyear_config.c import.c utils_str.c 
Log Message:
minor corrections 

Index: gsb_data_transaction.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- gsb_data_transaction.c	12 Sep 2009 19:33:40 -0000	1.72
+++ gsb_data_transaction.c	26 Oct 2009 22:38:21 -0000	1.73
@@ -100,6 +100,8 @@
 
 /*START_STATIC*/
 static void gsb_data_transaction_delete_all_transactions ( void );
+static gint gsb_data_transaction_find_by_payment_content ( const gchar *string,
+                        gint account_number );
 static  void gsb_data_transaction_free ( struct_transaction *transaction);
 static gint gsb_data_transaction_get_last_white_number (void);
 static struct_transaction *gsb_data_transaction_get_transaction_by_no ( gint transaction_number );
@@ -2565,6 +2567,27 @@
     return list_tmp;
 }
 
+
+/**
+ * get the id of the transaction
+ *
+ * \param transaction_number the number of the transaction
+ * 
+ * \return the id of the transaction
+ * */
+const gchar *gsb_data_transaction_get_id ( gint transaction_number )
+{
+    struct_transaction *transaction;
+
+    transaction = gsb_data_transaction_get_transaction_by_no ( transaction_number);
+
+    if ( !transaction )
+        return NULL;
+
+    return transaction -> transaction_id;
+}
+
+
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: accueil.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/accueil.c,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -d -r1.216 -r1.217
--- accueil.c	12 Oct 2009 20:55:32 -0000	1.216
+++ accueil.c	26 Oct 2009 22:38:21 -0000	1.217
@@ -2103,7 +2103,7 @@
     gchar * tmpstr;
 
     /* at the first use of grisbi,label_titre_fichier doesn't still exist */
-    if ( !label_titre_fichier )
+    if ( !label_titre_fichier || !GTK_IS_LABEL ( label_titre_fichier ) )
         return;
 
     if ( title && strlen ( title ) > 0 )

Index: gsb_data_transaction.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_transaction.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- gsb_data_transaction.h	12 Sep 2009 19:33:40 -0000	1.33
+++ gsb_data_transaction.h	26 Oct 2009 22:38:21 -0000	1.34
@@ -23,8 +23,6 @@
 gboolean gsb_data_transaction_copy_transaction ( gint source_transaction_number,
                         gint target_transaction_number );
 gint gsb_data_transaction_find_by_id ( gchar *id, gint account_number );
-gint gsb_data_transaction_find_by_payment_content ( const gchar *string,
-                        gint account_number );
 gint gsb_data_transaction_get_account_number ( gint transaction_number );
 gsb_real gsb_data_transaction_get_adjusted_amount ( gint transaction_number,
                         gint return_exponent );
@@ -48,6 +46,7 @@
 gsb_real gsb_data_transaction_get_exchange_fees ( gint transaction_number );
 gsb_real gsb_data_transaction_get_exchange_rate ( gint transaction_number );
 gint gsb_data_transaction_get_financial_year_number ( gint transaction_number );
+const gchar *gsb_data_transaction_get_id ( gint transaction_number );
 gint gsb_data_transaction_get_last_number (void);
 gint gsb_data_transaction_get_marked_transaction ( gint transaction_number );
 const gchar *gsb_data_transaction_get_method_of_payment_content ( gint transaction_number );

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.298
retrieving revision 1.299
diff -u -d -r1.298 -r1.299
--- import.c	18 Oct 2009 17:46:21 -0000	1.298
+++ import.c	26 Oct 2009 22:38:21 -0000	1.299
@@ -123,7 +123,12 @@
 static gint gsb_import_create_imported_account ( struct struct_compte_importation *imported_account );
 static gint gsb_import_create_transaction ( struct struct_ope_importation *imported_transaction,
                         gint account_number, gchar * origine );
+static gboolean gsb_import_define_action ( struct struct_compte_importation *imported_account,
+                        gint account_number,
+                        GDate *first_date_import );
+static GDate *gsb_import_get_first_date ( GSList *import_list );
 static gboolean gsb_import_gunzip_file ( gchar *filename );
+static gboolean gsb_import_set_id_compte ( gint account_nb, gchar *imported_id );
 static gboolean gsb_import_set_tmp_file ( gchar *filename,
                         gchar * pointeur_char );
 static gboolean import_account_action_activated ( GtkWidget * radio, gint action );
@@ -1814,181 +1819,35 @@
                         gint account_number )
 {
     GSList *list_tmp;
-    const GDate *last_date_import;
+    GDate *first_date_import = NULL;
     gint demande_confirmation;
-    GSList *list_tmp_transactions;
-	gchar* tmpstr;
 
-    /* check the imported account id, and set it in the grisbi account if it doesn't exist or if it's wrong */
+    /* check the imported account id, and set it in the grisbi account if it doesn't 
+     * exist or if it's wrong */
     if ( imported_account -> id_compte )
     {
-    if ( gsb_data_account_get_id (account_number) )
-    {
-        if ( g_ascii_strcasecmp ( gsb_data_account_get_id (account_number),
-				imported_account -> id_compte ))
-	    {
-		/* there is a difference between the imported account id and grisbi account id,
-		 * ask to be sure */
-		gchar* tmpstr = g_strdup_printf ( _("The Grisbi's id account is %s, but the imported id account is %s.\n\nPerhaps you choose a wrong account ?\nIf you choose to continue, the id of the Grisbi's account will be changed.  Do you want to continue ?"),
-							      gsb_data_account_get_id (account_number),
-							      imported_account -> id_compte );
-		if ( question_yes_no_hint ( _("The id of the imported and chosen accounts are different"),
-					    tmpstr,
-					    GTK_RESPONSE_NO ))
-		{
-		    g_free ( tmpstr );
-		    gsb_data_account_set_id ( account_number,
-					      imported_account -> id_compte );
-		}
-		else
-		{
-		    g_free ( tmpstr );
-		    return;
-		}
-	    }
-	}
-	else
-	    gsb_data_account_set_id (account_number,
-				     imported_account -> id_compte );
+        if ( ! gsb_import_set_id_compte ( account_number, imported_account -> id_compte ) )
+            return;
     }
 
-    /* on fait un premier tour de la liste des opés pour repérer celles qui sont déjà entrées */
-    /*   si on n'importe que du ofx, c'est facile, chaque opé est repérée par une id */
-    /*     donc si l'opé importée a une id, il suffit de rechercher l'id dans le compte, si elle */
-    /*     n'y est pas l'opé est à enregistrer */
-    /*     si on importe du qif, il n'y a pas d'id. donc soit on retrouve une opé semblable */
-    /*     (cad même montant et même date, on ne fait pas joujou avec le tiers car l'utilisateur */
-    /* a pu le changer), et on demande à l'utilisateur quoi faire, sinon on enregistre l'opé */
-
-
-    /* pour gagner en rapidité, on va récupérer la dernière date du compte, toutes les opés importées */
-    /* qui ont une date supérieure sont automatiquement acceptées */
-    list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
-    last_date_import = NULL;
-
-    while ( list_tmp_transactions )
-    {
-	gint transaction_number_tmp;
-	transaction_number_tmp = gsb_data_transaction_get_transaction_number (list_tmp_transactions -> data);
+    /* on fait un premier tour de la liste des opés pour repérer celles qui sont déjà entrées
+     * si on n'importe que du ofx, c'est facile, chaque opé est repérée par une id 
+     * donc si l'opé importée a une id, il suffit de rechercher l'id dans le compte, si elle 
+     * n'y est pas l'opé est à enregistrer 
+     * si on importe du qif, il n'y a pas d'id. donc soit on retrouve une opé semblable 
+     * (cad même montant et même date, on ne fait pas joujou avec le tiers car l'utilisateur  
+     * a pu le changer), et on demande à l'utilisateur quoi faire, sinon on enregistre l'opé
+     */
 
-	if ( gsb_data_transaction_get_account_number (transaction_number_tmp) == account_number )
-	{
-	    if ( !last_date_import
-		 ||
-		 g_date_compare ( gsb_data_transaction_get_date (transaction_number_tmp),
-				  last_date_import ) > 0 )
-		last_date_import = gsb_data_transaction_get_date (transaction_number_tmp);
-	}
-	list_tmp_transactions = list_tmp_transactions -> next;
-    }
+    /* pour gagner en rapidité, on va récupérer la date de la première opération qui pourrait 
+     * être dans le fichier importé */
+    first_date_import = gsb_import_get_first_date ( imported_account -> operations_importees );
 
-    /* ok, now last_date_import contains the last transaction date used in that account,
+    /* ok, now firt_date_import contains the firt transaction date used in that account,
      * can check the imported transactions */
-    list_tmp = imported_account -> operations_importees;
-    demande_confirmation = 0;
-
-    while ( list_tmp )
-    {
-        struct struct_ope_importation *imported_transaction;
-        imported_transaction = list_tmp -> data;
-
-        /* on remplace ici le caractère utilisé pour contourner le bug de la libofx "&"
-           par le bon caractère "°"
-           regarder si on ne pourrait pas utiliser imported_account -> type_de_compte */
-        if ( g_ascii_strcasecmp (imported_account -> origine, "OFX") == 0 
-         && imported_transaction -> cheque )
-            imported_transaction -> tiers = my_strdelimit (
-                        imported_transaction -> tiers, "&", "°" );
-
-        /* on ne fait le tour de la liste des opés que si la date de l'opé importée est 
-         * inférieure à la dernière date de la liste ou si on va fusionner avec des  
-         * opérations planifiées automatiques */
-
-        if ( (last_date_import && g_date_compare ( last_date_import,
-                            imported_transaction -> date ) >= 0) ||
-                            etat.get_fusion_import_planed_transactions )
-        {
-            gint transaction_no;
-            /* that transaction is before the last transaction in the account,
-             * so check if the transaction already exists */
-
-            /* first check the id */
-            if ( imported_transaction -> id_operation
-             &&
-             ( transaction_no = gsb_data_transaction_find_by_id (
-                            imported_transaction -> id_operation, account_number ) ) )
-            {
-                /* the id exists with the same account_nb, so the transaction is already
-                 * in grisbi we will forget that transaction */
-                imported_transaction -> action = IMPORT_TRANSACTION_LEAVE_TRANSACTION;
-            }
-            /* if no id, check the cheque */
-            tmpstr = utils_str_itoa (imported_transaction -> cheque);
-            if ( imported_transaction -> action != IMPORT_TRANSACTION_LEAVE_TRANSACTION
-             &&
-             imported_transaction -> cheque
-             &&
-             gsb_data_transaction_find_by_payment_content ( tmpstr,
-                                    account_number ))
-            /* found the cheque, forget that transaction */
-            imported_transaction -> action = IMPORT_TRANSACTION_LEAVE_TRANSACTION;
-
-            g_free ( tmpstr );
-
-            /* no id, no cheque, try to find the transaction */
-            if ( imported_transaction -> action != IMPORT_TRANSACTION_LEAVE_TRANSACTION )
-            {
-            GDate *date_debut_comparaison;
-            GDate *date_fin_comparaison;
-
-            date_debut_comparaison = g_date_new_dmy ( g_date_get_day ( imported_transaction -> date ),
-                                  g_date_get_month ( imported_transaction -> date ),
-                                  g_date_get_year ( imported_transaction -> date ));
-            g_date_subtract_days ( date_debut_comparaison,
-                           valeur_echelle_recherche_date_import );
-
-            date_fin_comparaison = g_date_new_dmy ( g_date_get_day ( imported_transaction -> date ),
-                                g_date_get_month ( imported_transaction -> date ),
-                                g_date_get_year ( imported_transaction -> date ));
-            g_date_add_days ( date_fin_comparaison,
-                      valeur_echelle_recherche_date_import );
-
-            list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
-
-            while ( list_tmp_transactions )
-            {
-                gint transaction_number_tmp;
-                transaction_number_tmp = gsb_data_transaction_get_transaction_number (
-                        list_tmp_transactions -> data);
-
-                if ( gsb_data_transaction_get_account_number (transaction_number_tmp) == account_number )
-                {
-                    if ( !gsb_real_cmp ( gsb_data_transaction_get_amount (transaction_number_tmp),
-                                imported_transaction -> montant )
-                         &&
-                         ( g_date_compare ( gsb_data_transaction_get_date (transaction_number_tmp),
-                                date_debut_comparaison ) >= 0 )
-                         &&
-                         ( g_date_compare ( gsb_data_transaction_get_date (transaction_number_tmp),
-                                date_fin_comparaison ) <= 0 )
-                         &&
-                         !imported_transaction -> ope_de_ventilation
-                         &&
-                         gsb_data_transaction_get_automatic_transaction (
-                                transaction_number_tmp) > 0 )
-                    {
-                        /* the imported transaction has the same date and same amount, will ask the user */
-                        imported_transaction -> action = IMPORT_TRANSACTION_ASK_FOR_TRANSACTION;
-                        imported_transaction -> ope_correspondante = transaction_number_tmp;
-                        demande_confirmation = 1;
-                    }
-                }
-                list_tmp_transactions = list_tmp_transactions -> next;
-            }
-            }
-        }
-        list_tmp = list_tmp -> next;
-    }
+    demande_confirmation = gsb_import_define_action ( imported_account,
+                        account_number,
+                        first_date_import );
 
     /* if we are not sure about some transactions, ask now */
     if ( demande_confirmation )
@@ -2011,21 +1870,24 @@
 
 	    /* set the account currency to the transaction and create the transaction */
 	    if (imported_account -> bouton_devise)
-		imported_transaction -> devise = gsb_currency_get_currency_from_combobox (imported_account -> bouton_devise);
+            imported_transaction -> devise = gsb_currency_get_currency_from_combobox (
+                        imported_account -> bouton_devise);
 	    else
-		imported_transaction -> devise = gsb_data_currency_get_number_by_code_iso4217 (imported_account -> devise);
+            imported_transaction -> devise = gsb_data_currency_get_number_by_code_iso4217 (
+                        imported_account -> devise);
 
 	    transaction_number = gsb_import_create_transaction ( imported_transaction,
-								 account_number, imported_account -> origine );
+                        account_number, imported_account -> origine );
 
 	    /* invert the amount of the transaction if asked */
 	    if (imported_account -> invert_transaction_amount)
-		gsb_data_transaction_set_amount ( transaction_number,
-						  gsb_real_opposite (gsb_data_transaction_get_amount (transaction_number)));
+            gsb_data_transaction_set_amount ( transaction_number,
+                        gsb_real_opposite (gsb_data_transaction_get_amount (
+                        transaction_number ) ) );
 
 	    /* we need to add the transaction now to the tree model here
 	     * to avoid to write again all the account */
-	    gsb_transactions_list_append_new_transaction (transaction_number, FALSE);
+	    gsb_transactions_list_append_new_transaction ( transaction_number, FALSE );
 	}
 	list_tmp = list_tmp -> next;
     }
@@ -2036,11 +1898,131 @@
     /* if we are on the current account, we need to update the tree_view */
     if (gsb_gui_navigation_get_current_account () == account_number)
     {
-	gsb_transactions_list_update_tree_view (account_number, TRUE);
-    gsb_data_account_colorize_current_balance ( account_number );
+        gsb_transactions_list_update_tree_view (account_number, TRUE);
+        gsb_data_account_colorize_current_balance ( account_number );
     }
 }
 
+
+/**
+ * 
+ * 
+ *
+ * \param 
+ *
+ * return 
+ */
+gboolean gsb_import_define_action ( struct struct_compte_importation *imported_account,
+                        gint account_number,
+                        GDate *first_date_import )
+{
+    GSList *list_tmp;
+    gint demande_confirmation = FALSE;
+    GSList *list_tmp_transactions;
+	gchar* tmpstr;
+
+    list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
+
+    while ( list_tmp_transactions )
+    {
+        gint transaction_number;
+        const gchar *transaction_id;
+        const gchar *content;
+
+        transaction_number = gsb_data_transaction_get_transaction_number (
+                list_tmp_transactions -> data);
+
+        if ( gsb_data_transaction_get_account_number ( transaction_number ) != account_number
+         ||
+         g_date_compare ( gsb_data_transaction_get_date ( transaction_number ),
+                        first_date_import ) < 0 )
+        {
+            list_tmp_transactions = list_tmp_transactions -> next;
+            continue;
+        }
+
+        transaction_id = gsb_data_transaction_get_id ( transaction_number );
+        content = gsb_data_transaction_get_method_of_payment_content ( transaction_number );
+
+        list_tmp = imported_account -> operations_importees;
+
+        while ( list_tmp )
+        {
+            struct struct_ope_importation *imported_transaction;
+
+            imported_transaction = list_tmp -> data;
+
+            /* on corrige le bug de la libofx */
+            if ( g_ascii_strcasecmp (imported_account -> origine, "OFX") == 0 
+             && imported_transaction -> cheque )
+                imported_transaction -> tiers = my_strdelimit (
+                        imported_transaction -> tiers, "&", "°" );
+
+            /* on compare les id s'ils existent */
+            if ( imported_transaction -> id_operation
+             &&
+             transaction_id
+             &&
+             !g_utf8_collate ( imported_transaction -> id_operation, transaction_id ) )
+                imported_transaction -> action = IMPORT_TRANSACTION_LEAVE_TRANSACTION;
+
+            /* found the cheque, forget that transaction */
+            tmpstr = utils_str_itoa (imported_transaction -> cheque);
+            if ( imported_transaction -> action != IMPORT_TRANSACTION_LEAVE_TRANSACTION
+             &&
+             imported_transaction -> cheque
+             &&
+             !g_utf8_collate ( tmpstr, content ) )
+                imported_transaction -> action = IMPORT_TRANSACTION_LEAVE_TRANSACTION;
+            g_free ( tmpstr );
+
+            /* no id, no cheque, try to find the transaction */
+            if ( imported_transaction -> action != IMPORT_TRANSACTION_LEAVE_TRANSACTION )
+            {
+                GDate *date_debut_comparaison;
+                GDate *date_fin_comparaison;
+
+                date_debut_comparaison = g_date_new_dmy ( g_date_get_day (
+                        imported_transaction -> date ),
+                        g_date_get_month ( imported_transaction -> date ),
+                        g_date_get_year ( imported_transaction -> date ));
+                        g_date_subtract_days ( date_debut_comparaison,
+                        valeur_echelle_recherche_date_import );
+
+                date_fin_comparaison = g_date_new_dmy ( g_date_get_day (
+                        imported_transaction -> date ),
+                        g_date_get_month ( imported_transaction -> date ),
+                        g_date_get_year ( imported_transaction -> date ));
+                        g_date_add_days ( date_fin_comparaison,
+                        valeur_echelle_recherche_date_import );
+                if ( !gsb_real_cmp ( gsb_data_transaction_get_amount (
+                        transaction_number ),
+                        imported_transaction -> montant )
+                 &&
+                 ( g_date_compare ( gsb_data_transaction_get_date ( transaction_number ),
+                        date_debut_comparaison ) >= 0 )
+                 &&
+                 ( g_date_compare ( gsb_data_transaction_get_date ( transaction_number ),
+                        date_fin_comparaison ) <= 0 )
+                 &&
+                 !imported_transaction -> ope_de_ventilation
+                 &&
+                 gsb_data_transaction_get_automatic_transaction ( transaction_number ) > 0 )
+                {
+                    /* the imported transaction has the same date and same amount, 
+                     * will ask the user */
+                    imported_transaction -> action = IMPORT_TRANSACTION_ASK_FOR_TRANSACTION;
+                    imported_transaction -> ope_correspondante = transaction_number;
+                    demande_confirmation = TRUE;
+                }
+            }
+            list_tmp = list_tmp -> next;
+        }
+        list_tmp_transactions = list_tmp_transactions -> next;
+    }
+
+    return demande_confirmation;
+}
 /**
  * called if we are not sure about some transactions to import
  * ask here to the user
@@ -2689,26 +2671,8 @@
     /*     si elle est différente, on demande si on la remplace */
     if ( imported_account -> id_compte )
     {
-	if ( gsb_data_account_get_id (account_number) )
-	{
-	    if ( g_ascii_strcasecmp ( gsb_data_account_get_id (account_number),
-				imported_account -> id_compte ))
-	    {
-		/* 		l'id du compte choisi et l'id du compte importé sont différents */
-		/* 		    on propose encore d'arrêter... */
-		if ( question_yes_no_hint ( _("The id of the imported and chosen accounts are different"),
-					    _("Perhaps you choose a wrong account ?  If you choose to continue, "
-                          "the id of the account will be changed.  Do you want to continue ?"),
-					    GTK_RESPONSE_NO ))
-		    gsb_data_account_set_id (account_number,
-					     my_strdup ( imported_account -> id_compte ));
-		else
-		    return;
-	    }
-	}
-	else
-	    gsb_data_account_set_id (account_number,
-				     my_strdup ( imported_account -> id_compte ));
+        if ( ! gsb_import_set_id_compte ( account_number, imported_account -> id_compte ) )
+            return;
     }
 
     /* on fait le tour des opés importées et recherche dans la liste d'opé s'il y a la 
@@ -3102,6 +3066,77 @@
 	gtk_widget_show ( dialog );
     }
 }
+
+
+/**
+ * 
+ * 
+ *
+ * \param 
+ *
+ * return 
+ */
+gboolean gsb_import_set_id_compte ( gint account_nb, gchar *imported_id )
+{
+    gchar *account_id;
+
+    account_id = gsb_data_account_get_id ( account_nb );
+    if ( account_id )
+	{
+	    if ( g_ascii_strcasecmp ( account_id, imported_id ) )
+	    {
+		/* 		l'id du compte choisi et l'id du compte importé sont différents */
+		/* 		    on propose encore d'arrêter... */
+            if ( question_yes_no_hint (
+                        _("The id of the imported and chosen accounts are different"),
+					    _("Perhaps you choose a wrong account ?  If you choose to continue, "
+                        "the id of the account will be changed.  Do you want to continue ?"),
+					    GTK_RESPONSE_NO ) )
+                gsb_data_account_set_id ( account_nb, my_strdup ( imported_id ) );
+            else
+                return FALSE;
+	    }
+	}
+	else
+	    gsb_data_account_set_id ( account_nb, my_strdup ( imported_id ) );
+
+    return TRUE;
+}
+
+
+/**
+ * 
+ * 
+ *
+ * \param 
+ *
+ * return 
+ */
+GDate *gsb_import_get_first_date ( GSList *import_list )
+{
+    GSList *list_tmp;
+    GDate *first_date = NULL;
+
+    list_tmp = import_list;
+
+    while ( list_tmp )
+    {
+        struct struct_ope_importation *imported_transaction;
+
+        imported_transaction = list_tmp -> data;
+
+        if ( !first_date
+         ||
+         g_date_compare ( imported_transaction -> date, first_date ) < 0 )
+            first_date = imported_transaction -> date;
+
+        list_tmp = list_tmp -> next;
+    }
+    g_date_subtract_days ( first_date, valeur_echelle_recherche_date_import );
+
+    return first_date;
+}
+
 /* *******************************************************************************/
 
 

Index: affichage.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/affichage.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- affichage.c	2 Oct 2009 21:35:04 -0000	1.167
+++ affichage.c	26 Oct 2009 22:38:21 -0000	1.168
@@ -621,6 +621,7 @@
 {
     if ( initial_file_title && strlen ( initial_file_title ) )
         g_free ( initial_file_title );
+
     initial_file_title = my_strdup ( gtk_entry_get_text ( GTK_ENTRY ( entry ) ) );
 
     if ( initial_file_title && strlen ( initial_file_title ) > 0 )
@@ -634,7 +635,7 @@
             titre_fichier = my_strdup ( initial_file_title );
         }
     }
-    else
+    else if ( GTK_IS_LABEL ( label_titre_fichier ) )
         gtk_label_set_text ( GTK_LABEL ( label_titre_fichier ), "" );
 
     /* Update window title */

Index: gsb_currency.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gsb_currency.c	24 Aug 2009 13:11:48 -0000	1.41
+++ gsb_currency.c	26 Oct 2009 22:38:21 -0000	1.42
@@ -89,8 +89,6 @@
 static gsb_real current_exchange_fees;
 
 
-
-
 /*START_EXTERN*/
 extern GtkWidget *combo_devise_totaux_categ;
 extern GtkWidget *combo_devise_totaux_ib;
@@ -162,13 +160,13 @@
 {
     GtkCellRenderer *text_renderer, *flag_renderer;
     GtkWidget *combo_box;
-
+devel_debug ("gsb_currency_make_combobox");
     if (!combobox_currency_store)
-	gsb_currency_create_combobox_store ();
-
+        gsb_currency_create_combobox_store ();
+printf ("phase 1\n");
     combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL 
                         (combobox_currency_store));
-
+printf ("phase 2\n");
     /* Flag renderer */
     flag_renderer = gtk_cell_renderer_pixbuf_new ();
     gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), flag_renderer, FALSE);
@@ -176,10 +174,10 @@
 				    "pixbuf", CURRENCY_COL_FLAG, NULL );
 
     GTK_CELL_RENDERER(flag_renderer) -> xpad = 3; /* Ugly but how to set it otherwise ?*/
-
+printf ("phase 3\n");
     text_renderer = gtk_cell_renderer_text_new ();
     gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), text_renderer, FALSE);
-
+printf ("phase 4\n");
     if (set_name)
 	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), text_renderer,
 					"text", CURRENCY_COL_NAME,
@@ -188,14 +186,14 @@
 	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), text_renderer,
 					"text", CURRENCY_COL_CODE,
 					NULL);
-
+printf ("phase 5\n");
     gtk_combo_box_set_active ( GTK_COMBO_BOX (combo_box),
 			       0 );
+printf ("phase 6\n");
     return (combo_box);
 }
 
 
-
 /**
  * set the combobox on the currency given in param
  *
@@ -709,10 +707,11 @@
  * */
 gboolean gsb_currency_create_combobox_store ( void )
 {
-    /* the currency list store, contains 3 columns :
+    /* the currency list store, contains 4 columns :
      * CURRENCY_COL_CODE : the code of the currency
      * CURRENCY_COL_NAME : the name(code) of the currency
-     * CURRENCY_COL_NUMBER : the number of the currency */
+     * CURRENCY_COL_NUMBER : the number of the currency 
+     * CURRENCY_COL_FLAG :  */
 
     combobox_currency_store = gtk_list_store_new ( CURRENCY_NUM_COL,
 						   G_TYPE_STRING,

Index: custom_list.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/custom_list.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- custom_list.c	7 Oct 2009 21:46:21 -0000	1.5
+++ custom_list.c	26 Oct 2009 22:38:21 -0000	1.6
@@ -103,7 +103,8 @@
 
     custom_list = (CustomList*) g_object_new (CUSTOM_TYPE_LIST, NULL);
 
-    g_assert( custom_list != NULL );
+    if ( custom_list == NULL )
+        return NULL;
 
     /* increase the table of CustomRecord */
     custom_list->num_rows = TRANSACTION_LIST_ROWS_NB;

Index: gsb_fyear_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_fyear_config.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- gsb_fyear_config.c	8 May 2009 17:21:15 -0000	1.23
+++ gsb_fyear_config.c	26 Oct 2009 22:38:21 -0000	1.24
@@ -797,7 +797,8 @@
 	dialogue (  tmpstr );
 	g_free ( tmpstr );
 	transaction_list_update_element (ELEMENT_EXERCICE);
-	modification_fichier ( TRUE );
+    if ( etat.modification_fichier == 0 )
+        modification_fichier ( TRUE );
     }
     else
 	dialogue ( _("no transaction to associate"));

Index: gsb_currency_config.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_currency_config.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- gsb_currency_config.c	8 Oct 2009 20:14:03 -0000	1.60
+++ gsb_currency_config.c	26 Oct 2009 22:38:21 -0000	1.61
@@ -1414,11 +1414,6 @@
 	return TRUE;
     }
 
-    //~ gchar* tmpstr = g_strdup_printf ( "failed to find '%s' in '%s'",
-				    //~ conv -> int_curr_symbol, country );
-    //~ warning_debug (tmpstr);
-    //~ g_free ( tmpstr );
-
     return FALSE;
 }
 

Index: utils_str.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_str.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- utils_str.c	14 Oct 2009 20:09:14 -0000	1.71
+++ utils_str.c	26 Oct 2009 22:38:21 -0000	1.72
@@ -27,7 +27,6 @@
 /*START_INCLUDE*/
 #include "utils_str.h"
 #include "./include.h"
-#include "./erreur.h"
 #include "./gsb_data_report.h"
 /*END_INCLUDE*/
 
@@ -871,8 +870,6 @@
     gunichar ch;
     gint i = 0;
 
-    devel_debug ( chaine );
-    
     tmpstr = g_malloc0 ( 11*sizeof (gchar) );
     ptr = g_strdup ( chaine );
     while ( g_utf8_strlen (ptr, -1) > 0 )



More information about the cvs mailing list