[kazehakase-svn] [3639] * src/kz-window.c: Use kz_bookmark_folder_get_child_index and

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Thu Feb 12 14:19:48 JST 2009


Revision: 3639
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3639
Author:   ikezoe
Date:     2009-02-12 14:19:48 +0900 (Thu, 12 Feb 2009)

Log Message:
-----------
	* src/kz-window.c: Use kz_bookmark_folder_get_child_index and
	kz_bookmark_folder_get_nth_child.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/kz-window.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-02-12 05:05:30 UTC (rev 3638)
+++ kazehakase/trunk/ChangeLog	2009-02-12 05:19:48 UTC (rev 3639)
@@ -16,6 +16,8 @@
 	kz_bookmark_folder_get_child_index.
 	* src/bookmarks/kz-proxy-folder.c: Use
 	kz_bookmark_folder_get_child_index.
+	* src/kz-window.c: Use kz_bookmark_folder_get_child_index and
+	kz_bookmark_folder_get_nth_child.
 
 2009-02-11  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/src/kz-window.c
===================================================================
--- kazehakase/trunk/src/kz-window.c	2009-02-12 05:05:30 UTC (rev 3638)
+++ kazehakase/trunk/src/kz-window.c	2009-02-12 05:19:48 UTC (rev 3639)
@@ -1770,7 +1770,6 @@
 			       KzWindow *kz)
 {
 	GtkWidget *bar;
-	GList *children;
 	gint pos;
 
 	g_return_if_fail(KZ_IS_BOOKMARK(child));
@@ -1783,11 +1782,9 @@
 	gtk_widget_show(bar);
 
 	/* reorder */
-	children = kz_bookmark_folder_get_children(KZ_BOOKMARK_FOLDER(bookmark));
-	pos = g_list_index(children, child);
+	pos = kz_bookmark_folder_get_child_index(KZ_BOOKMARK_FOLDER(bookmark), child);
 	gtk_box_reorder_child(GTK_BOX(kz->bookmark_bars_area),
 			      bar, pos);
-	g_list_free(children);
 }
 
 
@@ -2540,19 +2537,12 @@
 void
 kz_window_append_closed_tab (KzWindow *kz, KzBookmarkFolder *bookmark)
 {
-	GList *children;
-
+	KzBookmark *last;
 	kz_bookmark_folder_prepend(KZ_BOOKMARK_FOLDER(kz->closed_tabs), KZ_BOOKMARK(bookmark));
 
 	/* removed the oldest one */
-	children = kz_bookmark_folder_get_children(KZ_BOOKMARK_FOLDER(kz->closed_tabs));
-	if (children)
-	{
-		KzBookmark *last;
-		last = g_list_nth_data(children, MAX_CLOSED_TABS);
-		if (last)
-			kz_bookmark_folder_remove(KZ_BOOKMARK_FOLDER(kz->closed_tabs), last);
-		g_list_free(children);
-	}
+	last = kz_bookmark_folder_get_nth_child(KZ_BOOKMARK_FOLDER(kz->closed_tabs), MAX_CLOSED_TABS);
+	if (last)
+		kz_bookmark_folder_remove(KZ_BOOKMARK_FOLDER(kz->closed_tabs), last);
 }
 




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