[gnumeric] Update modification times. [#603099]



commit cd4fbf2549ea59f12277231fc6c17f1eaef469b0
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed Dec 9 01:28:15 2009 -0700

    Update modification times. [#603099]
    
    2009-12-09  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* gutils.c (gnm_insert_meta_date): new
    	* gutils.h (gnm_insert_meta_date): new
    	* workbook-view.c (wbv_save_to_output): update modification time
    	* workbook.c (workbook_new): update creation date

 ChangeLog           |    7 +++++++
 NEWS                |    3 ++-
 src/gutils.c        |   16 ++++++++++++++++
 src/gutils.h        |    4 ++++
 src/workbook-view.c |    3 +++
 src/workbook.c      |    2 ++
 6 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 63758c9..084a4cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-09  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* gutils.c (gnm_insert_meta_date): new
+	* gutils.h (gnm_insert_meta_date): new
+	* workbook-view.c (wbv_save_to_output): update modification time
+	* workbook.c (workbook_new): update creation date
+
 2009-12-06  Jean Brefort  <jean brefort normalesup org>
 
 	* src/item-bar.c (ib_draw_cell): clip when drawing text. [#603862]
diff --git a/NEWS b/NEWS
index c4b9d53..083163a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,8 @@ Gnumeric 1.9.17
 Andreas:
 	* Update EURO and EUROCONVERT with currencies added in 2207 to 2009.
 	* Export hyperlinks to ODF. [#603533]
-	* Make EUROCONVERT Excel compatible
+	* Make EUROCONVERT Excel compatible [#603755]
+	* Update modification times. [#603099]
 
 Jean:
 	* Fixed problem with row headers. [#603862]
diff --git a/src/gutils.c b/src/gutils.c
index 1627ea9..8607bc2 100644
--- a/src/gutils.c
+++ b/src/gutils.c
@@ -385,3 +385,19 @@ gnm_string_add_number (GString *buf, gnm_float d)
 }
 
 /* ------------------------------------------------------------------------- */
+
+void       
+gnm_insert_meta_date (GODoc *doc, char const *name)
+{
+	GValue *value = g_new0 (GValue, 1);
+	GTimeVal time;
+
+	g_get_current_time (&time);
+	time.tv_usec = 0L;
+	g_value_init (value, G_TYPE_STRING);
+	g_value_take_string (value,
+			     g_time_val_to_iso8601 (&time));
+	gsf_doc_meta_data_insert (go_doc_get_meta_data (doc), 
+				  g_strdup (name), 
+				  value);
+}
diff --git a/src/gutils.h b/src/gutils.h
index 301c975..95ef71d 100644
--- a/src/gutils.h
+++ b/src/gutils.h
@@ -32,6 +32,10 @@ gboolean   gnm_debug_flag (const char *flag);
 
 void       gnm_string_add_number (GString *buf, gnm_float d);
 
+/* Some Meta handling functions */
+
+void       gnm_insert_meta_date (GODoc *doc, char const *name); 
+
 G_END_DECLS
 
 #endif /* _GNM_GUTILS_H_ */
diff --git a/src/workbook-view.c b/src/workbook-view.c
index 572aee7..826fc0f 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -53,6 +53,7 @@
 
 #include <goffice/goffice.h>
 #include <gsf/gsf.h>
+#include <gsf/gsf-meta-names.h>
 #include <gsf/gsf-impl-utils.h>
 #include <gsf/gsf-output-stdio.h>
 #include <gsf/gsf-input.h>
@@ -966,6 +967,8 @@ wbv_save_to_output (WorkbookView *wbv, GOFileSaver const *fs,
 	GError const *err;
 	char const   *msg;
 
+	/* FIXME: we should be using the true modification time */
+	gnm_insert_meta_date (GO_DOC (wbv->wb), GSF_META_NAME_DATE_MODIFIED);
 	go_file_saver_save (fs, io_context, wbv, output);
 
 	/* The plugin convention is unclear */
diff --git a/src/workbook.c b/src/workbook.c
index 825e3d0..d1d449c 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -42,6 +42,7 @@
 
 #include <gsf/gsf-doc-meta-data.h>
 #include <gsf/gsf-impl-utils.h>
+#include <gsf/gsf-meta-names.h>
 #include <glib/gi18n-lib.h>
 #include <string.h>
 #include <errno.h>
@@ -311,6 +312,7 @@ workbook_new (void)
 		g_free (name);
 		g_free (nameutf8);
 	} while (!is_unique);
+	gnm_insert_meta_date (GO_DOC (wb), GSF_META_NAME_DATE_CREATED);
 	return wb;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]