svnno****@sourc*****
svnno****@sourc*****
Thu Feb 12 13:49:53 JST 2009
Revision: 3636 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3636 Author: ikezoe Date: 2009-02-12 13:49:53 +0900 (Thu, 12 Feb 2009) Log Message: ----------- kz_bookmark_folder_get_nth_child and kz_bookmark_folder_foreach_child. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/bookmarks/kz-proxy-folder.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2009-02-12 04:45:48 UTC (rev 3635) +++ kazehakase/trunk/ChangeLog 2009-02-12 04:49:53 UTC (rev 3636) @@ -11,7 +11,7 @@ * src/kz-window.c, src/kz-xbel.c, src/kz-thumbnails-view.c: Use kz_bookmark_folder_foreach_child. * src/kz-bookmarks/kz-proxy-folder.c: Use - kz_bookmark_folder_get_nth_child. + kz_bookmark_folder_get_nth_child and kz_bookmark_folder_foreach_child. 2009-02-11 Hiroyuki Ikezoe <poinc****@ikezo*****> Modified: kazehakase/trunk/src/bookmarks/kz-proxy-folder.c =================================================================== --- kazehakase/trunk/src/bookmarks/kz-proxy-folder.c 2009-02-12 04:45:48 UTC (rev 3635) +++ kazehakase/trunk/src/bookmarks/kz-proxy-folder.c 2009-02-12 04:49:53 UTC (rev 3636) @@ -109,24 +109,22 @@ return new; } - static void -create_proxy_folder (KzProxyFolder *proxy, KzBookmarkFolder *tabs) +append_current_page_bookmark (KzBookmark *bookmark, KzProxyFolder *proxy) { - GList *children, *node; - - children = kz_bookmark_folder_get_children(tabs); - - for (node = children; node; node = g_list_next(node)) - { - KzBookmark *cur_page; - cur_page = create_current_page_bookmark(KZ_BOOKMARK_FOLDER(node->data)); + KzBookmark *cur_page; + cur_page = create_current_page_bookmark(KZ_BOOKMARK_FOLDER(bookmark)); - kz_bookmark_folder_append(KZ_BOOKMARK_FOLDER(proxy), cur_page); - g_object_unref(cur_page); - } + kz_bookmark_folder_append(KZ_BOOKMARK_FOLDER(proxy), cur_page); + g_object_unref(cur_page); +} - g_list_free(children); +static void +create_proxy_folder (KzProxyFolder *proxy, KzBookmarkFolder *tabs) +{ + kz_bookmark_folder_foreach_child(tabs, + (GFunc)append_current_page_bookmark, + proxy); } @@ -253,14 +251,11 @@ index = g_list_index(list, sibling); if (index >= 0) { - GList *children; KzBookmark *sib; - - children = kz_bookmark_folder_get_children(KZ_BOOKMARK_FOLDER(proxy)); - sib = KZ_BOOKMARK(g_list_nth_data(children, index)); + sib = kz_bookmark_folder_get_nth_child(KZ_BOOKMARK_FOLDER(proxy), + index); kz_bookmark_folder_insert_before(KZ_BOOKMARK_FOLDER(proxy), new, sib); - g_list_free(children); } g_list_free(list); }