svnno****@sourc*****
svnno****@sourc*****
Thu Feb 5 14:10:10 JST 2009
Revision: 3611 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3611 Author: ikezoe Date: 2009-02-05 14:10:10 +0900 (Thu, 05 Feb 2009) Log Message: ----------- 2009-02-05 Hiroyuki Ikezoe <poinc****@ikezo*****> * module/embed/webkit-gtk/kz-webkit-gtk.c: Create a new WebKitWebHistoryItem if webkit_web_back_forward_list_get_current_item() returns NULL. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2009-02-04 03:12:09 UTC (rev 3610) +++ kazehakase/trunk/ChangeLog 2009-02-05 05:10:10 UTC (rev 3611) @@ -1,3 +1,9 @@ +2009-02-05 Hiroyuki Ikezoe <poinc****@ikezo*****> + + * module/embed/webkit-gtk/kz-webkit-gtk.c: Create a new + WebKitWebHistoryItem if + webkit_web_back_forward_list_get_current_item() returns NULL. + 2009-02-04 Hiroyuki Ikezoe <poinc****@ikezo*****> * module/embed/webkit-gtk/kz-webkit-gtk.c: Implement copy_page and Modified: kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c =================================================================== --- kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c 2009-02-04 03:12:09 UTC (rev 3610) +++ kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c 2009-02-05 05:10:10 UTC (rev 3611) @@ -703,6 +703,26 @@ } } +static WebKitWebHistoryItem * +ensure_current_item (KzEmbed *kzembed) +{ + WebKitWebBackForwardList *list; + WebKitWebHistoryItem *current_item = NULL; + KzWebKitGtkPrivate *priv = KZ_WEBKIT_GTK_GET_PRIVATE(kzembed); + + list = webkit_web_view_get_back_forward_list(priv->web_view); + if (list) + current_item = webkit_web_back_forward_list_get_current_item(list); + + if (!current_item) + { + current_item = webkit_web_history_item_new_with_data(priv->location, + priv->title); + } + + return current_item; +} + static void get_history (KzEmbed *kzembed, KzBookmark *history) { @@ -717,7 +737,7 @@ backward_items = webkit_web_back_forward_list_get_back_list_with_limit(list, 99); forward_items = webkit_web_back_forward_list_get_forward_list_with_limit(list, 99); - current_item = webkit_web_back_forward_list_get_current_item(list); + current_item = ensure_current_item(kzembed); children = kz_bookmark_get_children(history); bookmark_node = children;