[grisbi-cvs] grisbi/src Makefile.am, 1.157, 1.158 gsb_file.c, 1.54, 1.55 utils_dates.c, 1.54, 1.55
Pierre Biava
pbiava at users.sourceforge.net
Sat Jun 6 21:28:09 CEST 2009
Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23305/src
Modified Files:
Makefile.am gsb_file.c utils_dates.c
Log Message:
change the name of the backup file to ensure compatibility with windows
Index: utils_dates.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_dates.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- utils_dates.c 24 May 2009 16:42:39 -0000 1.54
+++ utils_dates.c 6 Jun 2009 19:28:07 -0000 1.55
@@ -524,12 +524,12 @@
if ( !date || !g_date_valid ( date ))
{
- return my_strdup ( "" );
+ return g_strdup ( "" );
}
g_date_strftime ( retour_str, SIZEOF_FORMATTED_STRING_DATE, "%m/%d/%Y", date );
- return my_strdup ( retour_str );
+ return g_strdup ( retour_str );
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/Makefile.am,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- Makefile.am 23 May 2009 15:54:12 -0000 1.157
+++ Makefile.am 6 Jun 2009 19:28:07 -0000 1.158
@@ -1,7 +1,7 @@
# Process this file with automake to produce Makefile.in
localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir) -I$(includedir) -I../intl -DLOCALEDIR=\"$(localedir)\" -DPIXMAPS_DIR="\"$(datadir)/pixmaps/@PACKAGE@\"" -DPLUGINS_DIR="\"$(prefix)/lib/@PACKAGE@\"" -DLOGO_PATH="\"$(datadir)/pixmaps/@PACKAGE@/grisbi-logo.png\"" -DDATA_PATH="\"$(datadir)/@PACKAGE@\"" -DHELP_PATH="\"$(datadir)/doc/@PACKAGE@\"" -Wall
+INCLUDES = -I$(top_srcdir) -I$(includedir) -I../intl -DLOCALEDIR=\"$(localedir)\" -DPIXMAPS_DIR="\"$(datadir)/pixmaps/@PACKAGE@\"" -DPLUGINS_DIR="\"$(prefix)/lib/@PACKAGE@\"" -DLOGO_PATH="\"$(datadir)/pixmaps/@PACKAGE@/grisbi-logo.png\"" -DDATA_PATH="\"$(datadir)/@PACKAGE@\"" -DHELP_PATH="\"$(datadir)/doc/@PACKAGE@\"" -Wall
bin_PROGRAMS = grisbi
# TODO: This manual setting of -Wl is a hack, I cannot get it from
Index: gsb_file.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_file.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- gsb_file.c 6 Jun 2009 17:41:46 -0000 1.54
+++ gsb_file.c 6 Jun 2009 19:28:07 -0000 1.55
@@ -612,19 +612,31 @@
gsb_status_message ( _("Saving backup") );
name = g_path_get_basename (nom_fichier_comptes);
+ if ( g_str_has_suffix ( name, ".gsb" ) )
+ {
+ gchar **tab_str;
+ tab_str = g_strsplit ( name, ".gsb", 0 );
+ if ( tab_str[0] && strlen ( tab_str[0] ) )
+ {
+ g_free ( name );
+ name = g_strdup ( tab_str[0] );
+ g_strfreev ( tab_str );
+ }
+ }
/* create a filename for the backup :
- * filename-yyyy-mm-dd_mm:hh:ss */
+ * filename_yyyymmddTmmhhss.gsb */
time ( &temps );
day_time = localtime (&temps);
- filename = g_strdup_printf ( "%s/%s_%d-%02d-%02d_%02d:%02d:%02d",
- gsb_file_get_backup_path (),
- name,
- day_time -> tm_year + 1900, day_time -> tm_mon + 1, day_time -> tm_mday,
- day_time -> tm_hour, day_time -> tm_min, day_time -> tm_sec );
+ filename = g_strdup_printf ( "%s%s%s_%d%02d%02dT%02d%02d%02d.gsb",
+ gsb_file_get_backup_path (),
+ G_DIR_SEPARATOR_S,
+ name,
+ day_time -> tm_year + 1900, day_time -> tm_mon + 1, day_time -> tm_mday,
+ day_time -> tm_hour, day_time -> tm_min, day_time -> tm_sec );
retour = gsb_file_save_save_file ( filename,
- etat.compress_backup,
- FALSE );
+ etat.compress_backup,
+ FALSE );
g_free (filename);
g_free (name);
More information about the cvs
mailing list