[grisbi-cvs] grisbi/src gsb_file_load.c,1.177,1.178
Pierre Biava
pbiava at users.sourceforge.net
Sat May 23 23:29:03 CEST 2009
- Previous message: [grisbi-cvs] grisbi/src gsb_data_account.h, 1.36, 1.37 gsb_data_account_cunit.c, 1.1, 1.2 gsb_file_config.c, 1.75, 1.76 gsb_file_load.c, 1.176, 1.177 gsb_file_save.c, 1.125, 1.126 gsb_file_save.h, 1.6, 1.7 main.c, 1.146, 1.147 main_cunit.c, 1.2, 1.3 parametres.c, 1.194, 1.195 utils_files.c, 1.40, 1.41 utils_files.h, 1.22, 1.23 utils_str.c, 1.64, 1.65 utils_str.h, 1.41, 1.42
- Next message: [grisbi-cvs] grisbi/src gsb_data_account.c,1.77,1.78
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7444
Modified Files:
gsb_file_load.c
Log Message:
rewrite the function gsb_file_load_copy_old_file ()
Index: gsb_file_load.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file_load.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- gsb_file_load.c 23 May 2009 19:25:10 -0000 1.177
+++ gsb_file_load.c 23 May 2009 21:29:00 -0000 1.178
@@ -87,7 +87,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_and_glib ( gchar *filename, gchar *file_content);
+static void gsb_file_load_copy_old_file ( gchar *filename, gchar *file_content);
static void gsb_file_load_currency ( const gchar **attribute_names,
const gchar **attribute_values );
static void gsb_file_load_currency_link ( const gchar **attribute_names,
@@ -345,13 +345,8 @@
else
{
/* copy of an old file grisbi */
-//~ #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
+ gsb_file_load_copy_old_file ( filename, file_content );
+
/* 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;
@@ -7908,13 +7903,11 @@
*
* \return TRUE : ok, FALSE : problem
* */
-/*gboolean gsb_file_load_copy_old_file ( gchar *filename )
+
+void gsb_file_load_copy_old_file ( gchar *filename, gchar *file_content)
{
if ( g_str_has_suffix (filename, ".gsb" ) )
{
- gchar *new_filename;
- GFile * file_ori;
- GFile * file_copy;
GError * error = NULL;
copy_old_filename = g_path_get_basename ( filename );
@@ -7923,31 +7916,22 @@
copy_old_filename = g_build_filename ( G_DIR_SEPARATOR_S,
my_get_XDG_grisbi_data_dir (),
copy_old_filename, NULL );
+
+#if GLIB_CHECK_VERSION (2,18,0)
+ GFile * file_ori;
+ GFile * file_copy;
+
file_ori = g_file_new_for_path ( filename );
file_copy = g_file_new_for_path ( copy_old_filename );
if ( !g_file_copy ( file_ori, file_copy, G_FILE_COPY_OVERWRITE,
NULL, NULL, NULL, &error ) )
dialogue_error (error -> message );
- }
- return TRUE;
-} */
-
-gboolean gsb_file_load_copy_old_file_and_glib ( gchar *filename, gchar *file_content)
-{
- if ( g_str_has_suffix (filename, ".gsb" ) )
- {
- GError * error = NULL;
-
- copy_old_filename = g_path_get_basename ( filename );
- copy_old_filename = gsb_string_remplace_string ( copy_old_filename, ".gsb",
- "-old-version.gsb" );
- copy_old_filename = g_build_filename ( G_DIR_SEPARATOR_S,
- my_get_XDG_grisbi_data_dir (),
- copy_old_filename, NULL );
+#else
if ( ! g_file_set_contents ( copy_old_filename, file_content,-1, &error ) )
dialogue_error (error -> message );
+#endif
+ g_free ( copy_old_filename );
}
- return TRUE;
}
/* Local Variables: */
/* c-basic-offset: 4 */
- Previous message: [grisbi-cvs] grisbi/src gsb_data_account.h, 1.36, 1.37 gsb_data_account_cunit.c, 1.1, 1.2 gsb_file_config.c, 1.75, 1.76 gsb_file_load.c, 1.176, 1.177 gsb_file_save.c, 1.125, 1.126 gsb_file_save.h, 1.6, 1.7 main.c, 1.146, 1.147 main_cunit.c, 1.2, 1.3 parametres.c, 1.194, 1.195 utils_files.c, 1.40, 1.41 utils_files.h, 1.22, 1.23 utils_str.c, 1.64, 1.65 utils_str.h, 1.41, 1.42
- Next message: [grisbi-cvs] grisbi/src gsb_data_account.c,1.77,1.78
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cvs
mailing list