[Kazehakase-cvs] CVS update: kazehakase/src/mozilla

Back to archive index

Ryo SHIMIZU furyo****@users*****
Tue Oct 17 23:28:48 JST 2006


Index: kazehakase/src/mozilla/kz-mozembed.cpp
diff -u kazehakase/src/mozilla/kz-mozembed.cpp:1.206 kazehakase/src/mozilla/kz-mozembed.cpp:1.207
--- kazehakase/src/mozilla/kz-mozembed.cpp:1.206	Thu Sep 14 15:27:37 2006
+++ kazehakase/src/mozilla/kz-mozembed.cpp	Tue Oct 17 23:28:48 2006
@@ -28,6 +28,8 @@
 #include <gtkmozembed.h>
 #include <gtkmozembed_internal.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <sys/stat.h>
 
 #include "kazehakase.h"
 #include "kz-window.h"
@@ -1031,11 +1033,38 @@
 			gchar *filename;
 			filename = mozilla_store_history_file(kzembed);
 			if (filename)
+			{
+				GIOChannel *io;
+				struct stat st;
+				gchar *time;
+				gchar *timestamp_file;
+
+				timestamp_file = g_strconcat(g_get_home_dir(),
+							  HISTORY_DIR,
+							  "timestamp",
+							  NULL);
+
+				g_stat(filename, &st);
+				time = g_strdup_printf("%d", (int)st.st_mtime);
+
+				io = g_io_channel_new_file(timestamp_file, "a+", NULL);
+				g_io_channel_set_encoding(io, NULL, NULL);
+				g_io_channel_write_chars(io, time, strlen(time),
+							 NULL, NULL);
+				g_io_channel_write_chars(io, ",", 1, NULL, NULL);
+				g_io_channel_write_chars(io, filename, strlen(filename),
+							 NULL, NULL);
+				g_io_channel_write_chars(io, "\n", 1, NULL, NULL);
+				g_io_channel_shutdown(io, TRUE, NULL);
+				g_io_channel_unref(io);
 #if USE_HYPERESTRAIER
 				g_idle_add(estsearch_update_index, filename);
 #elif USE_RAST
 				g_idle_add(rast_update_index, filename);
 #endif
+				g_free(timestamp_file);
+				g_free(time);
+			}
 		}
 	}
 	


More information about the Kazehakase-cvs mailing list
Back to archive index