[kazehakase-svn] [3603] * module/embed/ie/kz-ie.c: Use gtk_ie_embed_set_whole_history.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Tue Feb 3 13:23:16 JST 2009


Revision: 3603
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3603
Author:   ikezoe
Date:     2009-02-03 13:23:16 +0900 (Tue, 03 Feb 2009)

Log Message:
-----------
	* module/embed/ie/kz-ie.c: Use gtk_ie_embed_set_whole_history.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/module/embed/ie/kz-ie.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-02-03 02:01:14 UTC (rev 3602)
+++ kazehakase/trunk/ChangeLog	2009-02-03 04:23:16 UTC (rev 3603)
@@ -1,6 +1,7 @@
 2009-02-03  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 
 	* module/embed/ie/kz-ie.c: Added many functions related to history.
+	* module/embed/ie/kz-ie.c: Use gtk_ie_embed_set_whole_history.
 
 2009-01-30  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/module/embed/ie/kz-ie.c
===================================================================
--- kazehakase/trunk/module/embed/ie/kz-ie.c	2009-02-03 02:01:14 UTC (rev 3602)
+++ kazehakase/trunk/module/embed/ie/kz-ie.c	2009-02-03 04:23:16 UTC (rev 3603)
@@ -916,25 +916,51 @@
 	kz_bookmark_set_current(history, current_position);
 }
 
-static void
-set_history (KzEmbed *kzembed, KzBookmark *history)
+static GList *
+bookmark_to_history_item_list (KzBookmark *history)
 {
 	GList *children, *node;
-	gint current_position;
+	GList *history_item_list = NULL;
 
 	children = kz_bookmark_get_children(history);
-	current_position = kz_bookmark_get_current(history);
+	if (children)
+		return NULL;
 
 	for (node = children; node; node = g_list_next(node))
 	{
-		/* FIXME */
+		KzBookmark *bookmark = KZ_BOOKMARK(node->data);
+		GtkIEEmbedHistoryItem *item;
+
+		item = gtk_ie_embed_history_item_new(kz_bookmark_get_link(bookmark),
+						     kz_bookmark_get_title(bookmark));
+		history_item_list =
+			g_list_append(history_item_list, item);
 	}
 
-	if (children)
-		g_list_free(children);
+	g_list_free(children);
+
+	return history_item_list;
 }
 
 static void
+set_history (KzEmbed *kzembed, KzBookmark *history)
+{
+	GList *history_item_list;
+	gint current_position;
+
+	current_position = kz_bookmark_get_current(history);
+
+	history_item_list = bookmark_to_history_item_list(history);
+	if (!history_item_list)
+		return;
+
+	gtk_ie_embed_set_whole_history(GTK_IE_EMBED(kzembed),
+				       history_item_list, current_position);
+	g_list_foreach(history_item_list, (GFunc)g_object_unref, NULL);
+	g_list_free(history_item_list);
+}
+
+static void
 copy_page (KzEmbed *src_embed, KzEmbed *dest_embed, KzEmbedCopyType type)
 {
 	gtk_ie_embed_load_url(GTK_IE_EMBED(dest_embed),




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