svnno****@sourc*****
svnno****@sourc*****
Thu Feb 12 15:01:04 JST 2009
Revision: 3646 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3646 Author: ikezoe Date: 2009-02-12 15:01:04 +0900 (Thu, 12 Feb 2009) Log Message: ----------- * src/sidebar/kz-thumbnails-sidebar.c, src/bookmarks/kz-bookmark-menu-item-list.c, src/actions/kz-smart-bookmark-action.c: Use KzBookmarkFolder methods. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/actions/kz-smart-bookmark-action.c kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c kazehakase/trunk/src/sidebar/kz-thumbnails-sidebar.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2009-02-12 05:52:49 UTC (rev 3645) +++ kazehakase/trunk/ChangeLog 2009-02-12 06:01:04 UTC (rev 3646) @@ -25,6 +25,9 @@ * src/bookmarks/kz-bookmark-folder.c (kz_bookmark_folder_remove): Do not unref child before signal emission. * src/bookmarks/kz-bookmark-bar.c: Use KzBookmarkFolder methods. + * src/sidebar/kz-thumbnails-sidebar.c, + src/bookmarks/kz-bookmark-menu-item-list.c, + src/actions/kz-smart-bookmark-action.c: Use KzBookmarkFolder methods. 2009-02-11 Hiroyuki Ikezoe <poinc****@ikezo*****> Modified: kazehakase/trunk/src/actions/kz-smart-bookmark-action.c =================================================================== --- kazehakase/trunk/src/actions/kz-smart-bookmark-action.c 2009-02-12 05:52:49 UTC (rev 3645) +++ kazehakase/trunk/src/actions/kz-smart-bookmark-action.c 2009-02-12 06:01:04 UTC (rev 3646) @@ -661,24 +661,18 @@ if (!sibling) { - GList *children; guint pos; - - children = kz_bookmark_folder_get_children(folder); - pos = g_list_index(children, child); + pos = kz_bookmark_folder_get_child_index(folder, child); if (pos < kz_bookmark_folder_get_current_position(folder)) insert_child(action, child, menuitem, pos); else insert_child(action, child, menuitem, pos + 1); - g_list_free(children); } else { - GList *children; gint pos; - children = kz_bookmark_folder_get_children(folder); + pos = kz_bookmark_folder_get_child_index(folder, sibling); - pos = g_list_index(children, sibling); gtk_menu_shell_insert(GTK_MENU_SHELL(action->menu), menuitem, pos - 1); action->menulist = g_list_insert(action->menulist, child, pos - 1); @@ -689,7 +683,6 @@ /* update icon and background text */ update_icon_and_bgtext(action); } - g_list_free(children); } } @@ -796,7 +789,7 @@ bookmark = KZ_BOOKMARK(action->menulist->data); else bookmark = action->bookmark; - +g_warning("%s", kz_bookmark_get_link(bookmark)); uri = kz_entry_action_get_text(KZ_ENTRY_ACTION(action)); smart_uri = kz_smart_bookmark_get_smart_uri(KZ_SMART_BOOKMARK(bookmark), uri); Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c =================================================================== --- kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c 2009-02-12 05:52:49 UTC (rev 3645) +++ kazehakase/trunk/src/bookmarks/kz-bookmark-menu-item-list.c 2009-02-12 06:01:04 UTC (rev 3646) @@ -280,11 +280,7 @@ kz = list->kz; if (sibling) - { - children = kz_bookmark_folder_get_children(KZ_BOOKMARK_FOLDER(folder)); - index = g_list_index(children, sibling); - g_list_free(children); - } + index = kz_bookmark_folder_get_child_index(KZ_BOOKMARK_FOLDER(folder), sibling); if (kz_bookmark_is_folder(child)) widget = kz_bookmark_folder_menu_item_new(kz, child); @@ -318,12 +314,9 @@ g_return_if_fail(KZ_IS_BOOKMARK(child)); - children = kz_bookmark_folder_get_children(KZ_BOOKMARK_FOLDER(folder)); - index = g_list_index(children, child); - g_list_free(children); + inde = kz_bookmark_folder_get_child_index(KZ_BOOKMARK_FOLDER(folder), child); + if (index < 0) return; - if (index == -1) return; - children = list->menu_shell->children; widget = g_list_nth_data(children, list->initial_children + index); Modified: kazehakase/trunk/src/sidebar/kz-thumbnails-sidebar.c =================================================================== --- kazehakase/trunk/src/sidebar/kz-thumbnails-sidebar.c 2009-02-12 05:52:49 UTC (rev 3645) +++ kazehakase/trunk/src/sidebar/kz-thumbnails-sidebar.c 2009-02-12 06:01:04 UTC (rev 3646) @@ -292,14 +292,11 @@ KzBookmarkFolder *tab; GtkWidget *kzembed; KzTabLabel *kztab; - GList *list; g_return_if_fail(KZ_IS_BOOKMARK(bookmark)); g_return_if_fail(KZ_IS_WINDOW(kz)); - list = kz_bookmark_folder_get_children(KZ_BOOKMARK_FOLDER(kz->closed_tabs)); - tab = KZ_BOOKMARK_FOLDER(g_list_nth_data(list, index)); - g_list_free(list); + tab = KZ_BOOKMARK_FOLDER(kz_bookmark_folder_get_nth_child(kz->closed_tabs, index)); g_return_if_fail(tab); kzembed = kz_window_open_new_tab(kz, NULL);