[grisbi-cvs] grisbi/src gsb_data_account.c, 1.90, 1.91 gsb_plugins.c, 1.20, 1.21 help.c, 1.91, 1.92 help.h, 1.10, 1.11 import.c, 1.296, 1.297 main.c, 1.152, 1.153 qif.c, 1.138, 1.139 utils.h, 1.25, 1.26 utils_str.c, 1.70, 1.71

Pierre Biava pbiava at users.sourceforge.net
Wed Oct 14 22:09:16 CEST 2009


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

Modified Files:
	gsb_data_account.c gsb_plugins.c help.c help.h import.c main.c 
	qif.c utils.h utils_str.c 
Log Message:
Fixed the bug 674 and minors fixes

Index: help.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/help.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- help.c	11 Oct 2009 16:24:34 -0000	1.91
+++ help.c	14 Oct 2009 20:09:13 -0000	1.92
@@ -1,22 +1,25 @@
-/* Fichier help.c */
-
-/*     Copyright (C)	2000-2003 Cédric Auger (cedric at grisbi.org) */
-/*			2008 Benjamin Drieu (bdrieu at april.org) */
-/* 			http://www.grisbi.org */
-
-/*     This program is free software; you can redistribute it and/or modify */
-/*     it under the terms of the GNU General Public License as published by */
-/*     the Free Software Foundation; either version 2 of the License, or */
-/*     (at your option) any later version. */
-
-/*     This program is distributed in the hope that it will be useful, */
-/*     but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the */
-/*     GNU General Public License for more details. */
-
-/*     You should have received a copy of the GNU General Public License */
-/*     along with this program; if not, write to the Free Software */
-/*     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+/* ************************************************************************** */
+/*                                                                            */
+/*     copyright (c)    2000-2003 Cédric Auger (cedric at grisbi.org)            */
+/*          2008 Benjamin Drieu (bdrieu at april.org)                            */
+/*          2008-2009 Pierre Biava (grisbi at pierre.biava.name)                 */
+/*          http://www.grisbi.org                                             */
+/*                                                                            */
+/*  This program is free software; you can redistribute it and/or modify      */
+/*  it under the terms of the GNU General Public License as published by      */
+/*  the Free Software Foundation; either version 2 of the License, or         */
+/*  (at your option) any later version.                                       */
+/*                                                                            */
+/*  This program is distributed in the hope that it will be useful,           */
+/*  but WITHOUT ANY WARRANTY; without even the implied warranty of            */
+/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
+/*  GNU General Public License for more details.                              */
+/*                                                                            */
+/*  You should have received a copy of the GNU General Public License         */
+/*  along with this program; if not, write to the Free Software               */
+/*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+/*                                                                            */
+/* ************************************************************************** */
 
 
 #include "include.h"
@@ -64,8 +67,7 @@
  * \param bouton	Widget that triggered this handler (not used).
  * \param data		Not used.
  */
-void a_propos ( GtkWidget *bouton,
-		gint data )
+void a_propos ( GtkWidget *bouton, gint data )
 {
     GdkPixbuf * logo;
     gchar *chemin_logo ;
@@ -135,12 +137,12 @@
 
     /* Plugins list */
     gchar* comments = g_strconcat ( _("Personal finance manager for everyone\n"),
-				    gsb_plugin_get_list(),
-                    "\n Version de GTK : (",
-                    get_gtk_run_version ( ),
-                    ") \n",
-				    warn_print,
-				    NULL );
+                        gsb_plugin_get_list(),
+                        "\n Version de GTK : (",
+                        get_gtk_run_version ( ),
+                        ") \n",
+                        warn_print,
+                        NULL );
 
     GtkWidget * about;
 
@@ -159,7 +161,7 @@
     gtk_about_dialog_set_website ( GTK_ABOUT_DIALOG (about), "http://www.grisbi.org/");
     gtk_about_dialog_set_license ( GTK_ABOUT_DIALOG (about), license );
     gtk_about_dialog_set_wrap_license ( GTK_ABOUT_DIALOG (about), TRUE );
-	gtk_about_dialog_set_version ( GTK_ABOUT_DIALOG (about), VERSION );
+    gtk_about_dialog_set_version ( GTK_ABOUT_DIALOG (about), VERSION );
     gtk_about_dialog_set_artists ( GTK_ABOUT_DIALOG (about), artists );
     gtk_about_dialog_set_documenters ( GTK_ABOUT_DIALOG (about), documenters );
     gtk_about_dialog_set_authors ( GTK_ABOUT_DIALOG (about), auteurs );
@@ -175,7 +177,7 @@
     gtk_widget_destroy (about);
 
     if (logo)
-	g_object_unref (logo);
+    g_object_unref (logo);
 
     return;
 }

Index: qif.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/qif.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- qif.c	24 Aug 2009 13:46:54 -0000	1.138
+++ qif.c	14 Oct 2009 20:09:14 -0000	1.139
@@ -485,9 +485,9 @@
 	imported_transaction = imported_account -> operations_importees -> data;
 	if (imported_transaction -> tiers
 	    &&
-	    (!g_strcasecmp (imported_transaction -> tiers, "Opening Balance")
+	    (!g_ascii_strcasecmp (imported_transaction -> tiers, "Opening Balance")
 	     ||
-	     !g_strcasecmp (imported_transaction -> tiers, _("Opening Balance"))))
+	     !g_ascii_strcasecmp (imported_transaction -> tiers, _("Opening Balance"))))
 	{
 	    /* ok, we are on an opening balance, we transfer the first transaction
 	     * to the initial datas of the account */

Index: utils.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- utils.h	11 Oct 2009 16:24:34 -0000	1.25
+++ utils.h	14 Oct 2009 20:09:14 -0000	1.26
@@ -6,8 +6,7 @@
 
 /* START_DECLARATION */
 gboolean assert_account_loaded ();
-gboolean desensitive_widget ( gpointer object,
-                        GtkWidget *widget );
+gboolean desensitive_widget ( gpointer object, GtkWidget *widget );
 gchar *get_gtk_run_version ( void );
 gboolean lance_navigateur_web ( const gchar *url );
 gboolean met_en_normal ( GtkWidget *event_box,

Index: help.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/help.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- help.h	8 Oct 2008 15:23:50 -0000	1.10
+++ help.h	14 Oct 2009 20:09:13 -0000	1.11
@@ -5,7 +5,6 @@
 
 
 /* START_DECLARATION */
-void a_propos ( GtkWidget *bouton,
-		gint data );
+void a_propos ( GtkWidget *bouton, gint data );
 /* END_DECLARATION */
 #endif

Index: import.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/import.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -d -r1.296 -r1.297
--- import.c	13 Oct 2009 17:13:14 -0000	1.296
+++ import.c	14 Oct 2009 20:09:13 -0000	1.297
@@ -138,7 +138,8 @@
 static gboolean import_select_file ( GtkWidget * button, GtkWidget * assistant );
 static gboolean import_switch_type ( GtkCellRendererText *cell, const gchar *path,
                         const gchar *value, GtkListStore * model );
-static void pointe_opes_importees ( struct struct_compte_importation *imported_account );
+static void pointe_opes_importees ( struct struct_compte_importation *imported_account,
+                        gint account_number );
 static void traitement_operations_importees ( void );
 /*END_STATIC*/
 
@@ -1440,8 +1441,8 @@
 
         case IMPORT_MARK_TRANSACTIONS:
         account_number = gsb_account_get_combo_account_number ( compte -> bouton_compte_mark );
-        pointe_opes_importees ( compte );
-        transaction_list_update_element (ELEMENT_MARK); 
+        pointe_opes_importees ( compte, account_number );
+        transaction_list_update_element (ELEMENT_MARK);
         break;
     }
 
@@ -1502,15 +1503,15 @@
     gsb_status_message ( _("Please wait") );
 
     /* update the name of accounts in scheduler form */
-    gsb_account_update_combo_list ( gsb_form_scheduler_get_element_widget (
-                                            SCHEDULED_FORM_ACCOUNT),
-                    FALSE );
+    gsb_account_update_combo_list (
+                        gsb_form_scheduler_get_element_widget ( SCHEDULED_FORM_ACCOUNT ),
+                        FALSE );
 
     /* set the rule button if necessary */
-    if (gsb_data_import_rule_account_has_rule (gsb_gui_navigation_get_current_account ()))
-    gtk_widget_show (menu_import_rules);
+    if ( gsb_data_import_rule_account_has_rule (gsb_gui_navigation_get_current_account ()))
+        gtk_widget_show (menu_import_rules);
     else
-    gtk_widget_hide (menu_import_rules);
+        gtk_widget_hide (menu_import_rules);
 
     /* show the account list */
     gsb_menu_update_accounts_in_menus();
@@ -1823,7 +1824,7 @@
     {
     if ( gsb_data_account_get_id (account_number) )
     {
-        if ( g_strcasecmp ( 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,
@@ -1917,8 +1918,6 @@
              ( transaction_no = gsb_data_transaction_find_by_id (
                             imported_transaction -> id_operation, account_number ) ) )
             {
-                printf ("transaction_no = %d id = %s\n",transaction_no,
-                        imported_transaction -> id_operation );
                 /* 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;
@@ -2675,15 +2674,15 @@
 
 
 
-/* *******************************************************************************/
-void pointe_opes_importees ( struct struct_compte_importation *imported_account )
+/**
+ *
+ *
+ * */
+void pointe_opes_importees ( struct struct_compte_importation *imported_account,
+                        gint account_number )
 {
     GSList *list_tmp;
     GSList *liste_opes_import_celibataires;
-    gint account_number;
-
-    /* on se place sur le compte dans lequel on va pointer les opés */
-    account_number = gsb_account_get_combo_account_number ( imported_account -> bouton_compte_mark );
 
     /* si le compte importé a une id, on la vérifie ici */
     /*     si elle est absente, on met celle importée */
@@ -2692,7 +2691,7 @@
     {
 	if ( gsb_data_account_get_id (account_number) )
 	{
-	    if ( g_strcasecmp ( 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 */
@@ -2736,7 +2735,7 @@
 	if ( ope_import -> id_operation
 	     &&
 	     (transaction_number = gsb_data_transaction_find_by_id (
-                        ope_import -> id_operation, account_number )))
+                        ope_import -> id_operation, account_number ) ) )
 	    ope_trouvees = g_slist_append ( ope_trouvees,
 					    GINT_TO_POINTER (transaction_number));
 
@@ -2761,20 +2760,19 @@
 	    g_date_add_days ( date_fin_comparaison,
 			      valeur_echelle_recherche_date_import );
 
-		ope_import -> montant = (imported_account -> invert_transaction_amount ? 
-				gsb_real_opposite(ope_import -> montant) :
-				ope_import -> montant);
-
+        if ( imported_account -> invert_transaction_amount )
+            ope_import -> montant =  gsb_real_opposite ( ope_import -> montant );
+ 
 	    list_tmp_transactions = gsb_data_transaction_get_transactions_list ();
 
 	    while ( list_tmp_transactions )
 	    {
-		transaction_number = gsb_data_transaction_get_transaction_number (list_tmp_transactions -> data);
-
+		transaction_number = gsb_data_transaction_get_transaction_number (
+                        list_tmp_transactions -> data);
 		if ( gsb_data_transaction_get_account_number (transaction_number) == account_number )
 		{
 		    if ( !gsb_real_cmp ( gsb_data_transaction_get_amount (transaction_number),
-					 ope_import -> montant )
+                        ope_import -> montant )
 			 &&
 			 ( g_date_compare ( gsb_data_transaction_get_date (transaction_number),
 					    date_debut_comparaison ) >= 0 )
@@ -2820,9 +2818,9 @@
 		/* si elle est déjà pointée ou relevée, on ne fait rien */
 		/* si l'opé d'import a une id et pas l'opé, on marque l'id dans l'opé */
 
-		transaction_number = GPOINTER_TO_INT (ope_trouvees -> data);
+        transaction_number = GPOINTER_TO_INT ( ope_trouvees -> data );
 
-		if ( !gsb_data_transaction_get_transaction_id (transaction_number)
+		if ( strlen ( gsb_data_transaction_get_transaction_id ( transaction_number ) ) == 0
 		     &&
 		     ope_import -> id_operation )
 		    gsb_data_transaction_set_transaction_id ( transaction_number,
@@ -2921,7 +2919,7 @@
 
 			transaction_number = GPOINTER_TO_INT (list_tmp_2 -> data);
 
-			if ( !gsb_data_transaction_get_transaction_id (transaction_number)
+			if ( strlen ( gsb_data_transaction_get_transaction_id ( transaction_number ) ) == 0
 			     &&
 			     ope_import -> id_operation )
 			    gsb_data_transaction_set_transaction_id ( transaction_number,
@@ -2962,9 +2960,10 @@
 		    /* on a trouvé un nombre différent d'opés d'import et d'opés semblables dans 
              * la liste d'opés on marque donc cette opé d'import comme seule */
 
-		    ope_import -> devise = gsb_currency_get_currency_from_combobox (imported_account -> bouton_devise);
-		    liste_opes_import_celibataires = g_slist_append ( liste_opes_import_celibataires,
-								      ope_import );
+		    ope_import -> devise = gsb_currency_get_currency_from_combobox (
+                        imported_account -> bouton_devise);
+		    liste_opes_import_celibataires = g_slist_append (
+                        liste_opes_import_celibataires, ope_import );
 
 		}
 	}
@@ -3945,7 +3944,7 @@
     {
         struct import_format * format = (struct import_format *) tmp -> data;
 
-        if ( !g_strcasecmp ( extension + 1, format -> extension ) )
+        if ( !g_ascii_strcasecmp ( extension + 1, format -> extension ) )
         {
         return format -> name;
         }
@@ -4045,7 +4044,8 @@
     if (strcmp (type, "OFX") && strcmp (type, "QIF"))
     {
         gchar *tmpstr = g_path_get_basename (filename);
-        gchar *tmpstr2 = g_strdup_printf (_("%s is neither an OFX file, neither a QIF file. Nothing will be done for that file."),
+        gchar *tmpstr2 = g_strdup_printf (_("%s is neither an OFX file, neither a QIF file. "
+                        "Nothing will be done for that file."),
                         tmpstr );
         dialogue_error (tmpstr2);
         g_free (tmpstr);
@@ -4123,7 +4123,8 @@
         break;
 
         case IMPORT_MARK_TRANSACTIONS:
-        pointe_opes_importees (account);
+        pointe_opes_importees ( account, account_number );
+        transaction_list_update_element (ELEMENT_MARK);
         break;
     }
 

Index: gsb_data_account.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_data_account.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- gsb_data_account.c	2 Oct 2009 21:35:04 -0000	1.90
+++ gsb_data_account.c	14 Oct 2009 20:09:12 -0000	1.91
@@ -655,9 +655,8 @@
 	{
 	    gchar *account_id_save;
 	    account_id_save = account -> account_id;
-	    if(g_strcasecmp(account_id,
-			    account -> account_id) == 0)
-		return account -> account_number;
+	    if ( g_ascii_strcasecmp ( account_id, account -> account_id ) == 0 )
+            return account -> account_number;
 	}
 	list_tmp = list_tmp -> next;
     }

Index: gsb_plugins.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_plugins.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- gsb_plugins.c	27 Apr 2009 19:41:03 -0000	1.20
+++ gsb_plugins.c	14 Oct 2009 20:09:13 -0000	1.21
@@ -40,12 +40,6 @@
 /** List of registered plugins.  It should contain gsb_plugin structures. */
 static GSList * plugins = NULL;
 
-/* filled when we ask to keep the password in memory
- * need to declare here instead of gsb_crypt.c to load the plugin openssl.so */
-gchar *crypt_key;
-
-
-
 /**
  *
  *

Index: main.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/main.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- main.c	11 Oct 2009 16:24:34 -0000	1.152
+++ main.c	14 Oct 2009 20:09:14 -0000	1.153
@@ -49,8 +49,8 @@
 #include "./import.h"
 #include "./parse_cmdline.h"
 #include "./gsb_file_config.h"
-#include "./include.h"
 #include "./structures.h"
+#include "./include.h"
 #include "./erreur.h"
 /*END_INCLUDE*/
 

Index: utils_str.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_str.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- utils_str.c	7 Oct 2009 21:46:21 -0000	1.70
+++ utils_str.c	14 Oct 2009 20:09:14 -0000	1.71
@@ -346,7 +346,7 @@
     string_2 = g_strdelimit ( string_2, "ôÔ", 'o' );
     string_2 = g_strdelimit ( string_2, "îÎ", 'i' );
 
-    result = g_strcasecmp ( string_1, string_2 );
+    result = g_ascii_strcasecmp ( string_1, string_2 );
     g_free(string_1);
     g_free(string_2);
     return result; 
@@ -422,11 +422,10 @@
 	    gint retour;
  	    gchar *new_1, *new_2;
 	    
-	    new_1 = g_utf8_collate_key ( g_utf8_casefold ( string_1,longueur ),
-					 longueur );
-	    new_2 = g_utf8_collate_key ( g_utf8_casefold (  string_2,longueur ),
-					 longueur );
-	    retour = g_strcasecmp ( 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 );



More information about the cvs mailing list