[grisbi-cvs] grisbi/src gsb_file_load.c,1.149,1.150

Pierre Biava pbiava at users.sourceforge.net
Sat Feb 14 22:41:14 CET 2009


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

Modified Files:
	gsb_file_load.c 
Log Message:
backwards to save the old account with the glib < 2.18

Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- gsb_file_load.c	12 Feb 2009 21:46:06 -0000	1.149
+++ gsb_file_load.c	14 Feb 2009 21:41:12 -0000	1.150
@@ -84,7 +84,7 @@
 static gboolean gsb_file_load_check_new_structure ( gchar *file_content );
 static void gsb_file_load_color_part ( const gchar **attribute_names,
 				const gchar **attribute_values );
-static gboolean gsb_file_load_copy_old_file ( gchar *filename );
+//~ static gboolean gsb_file_load_copy_old_file ( gchar *filename );
 static gboolean gsb_file_load_copy_old_file_and_glib ( gchar *filename, gchar *file_content);
 static void gsb_file_load_currency ( const gchar **attribute_names,
 			      const gchar **attribute_values );
@@ -322,13 +322,13 @@
 	else
 	{
         /* backup of an old file grisbi */
-#if GLIB_CHECK_VERSION(2,18,0)
-        if ( ! gsb_file_load_copy_old_file ( filename ) )
-            return FALSE;
-# else
+//~ #if GLIB_CHECK_VERSION(2,18,0)
+        //~ if ( ! gsb_file_load_copy_old_file ( filename ) )
+            //~ return FALSE;
+//~ # else
         if ( ! gsb_file_load_copy_old_file_and_glib ( filename, file_content ) )
             return FALSE;
-#endif
+//~ #endif
 	    /* fill the GMarkupParser for the last xml structure */
 	    markup_parser -> start_element = (void *) gsb_file_load_start_element_before_0_6;
 	    markup_parser -> end_element = (void *) gsb_file_load_end_element_before_0_6;
@@ -1786,6 +1786,11 @@
 	    /* get the entire real, even if the floating point of the currency is less deep */
 	    gsb_data_transaction_set_amount ( transaction_number,
 					      gsb_real_get_from_string (attribute_values[i]));
+        /* added by pbiava on the 02/14//2009 fix bug 417 */
+        if (attribute_values[i][0] == '-')
+            gsb_data_transaction_set_sign ( transaction_number, GSB_PAYMENT_DEBIT );
+        else
+            gsb_data_transaction_set_sign ( transaction_number, GSB_PAYMENT_CREDIT );
 	    i++;
 	    continue;
 	}
@@ -7665,7 +7670,7 @@
  *
  * \return TRUE : ok, FALSE : problem
  * */
-gboolean gsb_file_load_copy_old_file ( gchar *filename )
+/*gboolean gsb_file_load_copy_old_file ( gchar *filename )
 {
     if ( g_str_has_suffix (filename, ".gsb" ) )
     {
@@ -7692,7 +7697,7 @@
             dialogue_error (error -> message );
     }
     return FALSE;
-}
+} */
 
 gboolean gsb_file_load_copy_old_file_and_glib ( gchar *filename, gchar *file_content)
 {



More information about the cvs mailing list