[grisbi-cvs] grisbi/src help.c, 1.94, 1.95 utils_dates.c, 1.57, 1.58 utils_dates.h, 1.21, 1.22

Pierre Biava pbiava at users.sourceforge.net
Wed Nov 4 20:52:17 CET 2009


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

Modified Files:
	help.c utils_dates.c utils_dates.h 
Log Message:
update for creating the function of the build date

Index: utils_dates.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_dates.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- utils_dates.c	24 Aug 2009 18:59:46 -0000	1.57
+++ utils_dates.c	4 Nov 2009 19:52:14 -0000	1.58
@@ -547,6 +547,46 @@
     else
         return gsb_parse_date_string ( string );
 }
+
+
+/**
+ * retourne la date de compilation conforme à la locale
+ * 
+ * */
+gchar *gsb_date_get_compiled_time ( void )
+{
+    GDate *date;
+    gchar **tab;
+    gchar *str;
+    const gchar *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
+                            "Sep", "Oct", "Nov", "Dec"};
+    gint mois = 0;
+    gint i;
+
+    str = g_strdup ( __DATE__ );
+    if ( g_strstr_len ( str, -1, "  " ) )
+    {
+        tab = g_strsplit ( str, "  ", -1 );
+        str = g_strjoinv  (" ", tab);
+        g_strfreev (tab);
+    }
+    tab = g_strsplit ( str, " ", -1 );
+    g_free ( str );
+
+    for (i = 0; i < 12; i++)
+    {
+        if ( !strcmp ( tab[0], months[i] ) )
+        {
+          mois = i + 1;
+          break;
+        }
+    }
+
+    date = g_date_new_dmy ( atoi ( tab[1] ), mois, atoi ( tab[2] ) );
+    g_strfreev (tab);
+
+    return gsb_format_gdate ( date );
+}
 /* Local Variables: */
 /* c-basic-offset: 4 */
 /* End: */

Index: utils_dates.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/utils_dates.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- utils_dates.h	17 May 2009 15:53:26 -0000	1.21
+++ utils_dates.h	4 Nov 2009 19:52:14 -0000	1.22
@@ -11,6 +11,7 @@
 gboolean gsb_date_check_entry ( GtkWidget *entry );
 GDate *gsb_date_copy ( const GDate *date );
 void gsb_date_free_last_date ( void );
+gchar *gsb_date_get_compiled_time ( void );
 GDate *gsb_date_get_last_entry_date ( const gchar *string );
 void gsb_date_set_last_date ( const gchar *date );
 gchar *gsb_date_today ( void );

Index: help.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/help.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- help.c	3 Nov 2009 21:31:16 -0000	1.94
+++ help.c	4 Nov 2009 19:52:14 -0000	1.95
@@ -143,7 +143,7 @@
                         get_gtk_run_version ( ),
                         "\n",
                         _("This instance of Grisbi was compiled on\n"),
-						gsb_date_today ( ) ,
+						gsb_date_get_compiled_time ( ) ,
                         " ",
 						_("at"),
                         " ",



More information about the cvs mailing list