[kazehakase-svn] [3558] * src/bookmarks/kz-bookmark-tab-menu.c,

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Sat Jan 24 19:35:49 JST 2009


Revision: 3558
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3558
Author:   ikezoe
Date:     2009-01-24 19:35:49 +0900 (Sat, 24 Jan 2009)

Log Message:
-----------
	* src/bookmarks/kz-bookmark-tab-menu.c,
	src/bookmarks/kz-proxy-folder.c: Use kz_bookmark_get_current_bookmark.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/bookmarks/kz-bookmark-tab-menu.c
    kazehakase/trunk/src/bookmarks/kz-proxy-folder.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-01-24 10:26:29 UTC (rev 3557)
+++ kazehakase/trunk/ChangeLog	2009-01-24 10:35:49 UTC (rev 3558)
@@ -10,9 +10,11 @@
 	flag.
 	* src/bookmarks/kz-bookmark.[ch]: Added
 	kz_bookmark_get_current_bookmark.c
-	* src/kz-tab-label.c: Use kz_bookmark_get_current_bookmark.c
+	* src/kz-tab-label.c: Use kz_bookmark_get_current_bookmark.
 	* src/bookmarks/kz-bookmark.c: Invoke g_object_notify explicitly since
 	KzXBEL listening KzBookmark property change.
+	* src/bookmarks/kz-bookmark-tab-menu.c,
+	src/bookmarks/kz-proxy-folder.c: Use kz_bookmark_get_current_bookmark.
 
 2009-01-23  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/src/bookmarks/kz-bookmark-tab-menu.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-bookmark-tab-menu.c	2009-01-24 10:26:29 UTC (rev 3557)
+++ kazehakase/trunk/src/bookmarks/kz-bookmark-tab-menu.c	2009-01-24 10:35:49 UTC (rev 3558)
@@ -61,28 +61,21 @@
 	const gchar *title = NULL, *desc;
 	gchar *tooltip_text = NULL;
 	GtkWidget *favicon;
-	KzBookmark *cur_page;
-	gint cur_pos;
-	GList *pages;
+	KzBookmark *current_page;
 	KzFavicon *kzfav = KZ_GET_FAVICON;
 
 	g_return_val_if_fail(KZ_IS_BOOKMARK(bookmark), NULL);
 	g_return_val_if_fail(kz_bookmark_is_folder(bookmark), NULL);
 	g_return_val_if_fail(KZ_IS_WINDOW(kz), NULL);
 
-	cur_pos = kz_bookmark_get_current(bookmark);
-
-	pages = kz_bookmark_get_children(bookmark);
-	cur_page = KZ_BOOKMARK(g_list_nth_data(pages, cur_pos));
-	g_list_free(pages);
+	current_page = kz_bookmark_get_current_bookmark(bookmark);
+	if (!KZ_IS_BOOKMARK(current_page)) return NULL;
 	
-	if (!KZ_IS_BOOKMARK(cur_page)) return NULL;
-	
-	title = kz_bookmark_get_title(cur_page);
+	title = kz_bookmark_get_title(current_page);
 	if (!title)
 		title = "";
 
-	desc = kz_bookmark_get_description(cur_page);
+	desc = kz_bookmark_get_description(current_page);
 	if (desc)
 		tooltip_text = remove_tag(desc, strlen(desc));
 	
@@ -100,7 +93,7 @@
 
 	/* favicon */
 	favicon = kz_favicon_get_widget(kzfav,
-					kz_bookmark_get_link(cur_page),
+					kz_bookmark_get_link(current_page),
 					KZ_ICON_SIZE_BOOKMARK_MENU);
 	if (favicon)
 	{
@@ -115,7 +108,7 @@
 		gtk_widget_set_tooltip_text(menu_item, tooltip_text);
 		g_free(tooltip_text);
 	}
-	connect_bookmark_signals(menu_item, cur_page);
+	connect_bookmark_signals(menu_item, current_page);
 
 	return menu_item;
 }

Modified: kazehakase/trunk/src/bookmarks/kz-proxy-folder.c
===================================================================
--- kazehakase/trunk/src/bookmarks/kz-proxy-folder.c	2009-01-24 10:26:29 UTC (rev 3557)
+++ kazehakase/trunk/src/bookmarks/kz-proxy-folder.c	2009-01-24 10:35:49 UTC (rev 3558)
@@ -98,19 +98,13 @@
 static KzBookmark *
 create_current_page_bookmark (KzBookmark *tab)
 {
-	KzBookmark *cur_page;
-	guint cur_pos;
-	GList *pages;
+	KzBookmark *current_page;
 	KzBookmark *new;
 
-	cur_pos = kz_bookmark_get_current(tab);
+	current_page = kz_bookmark_get_current_bookmark(tab);
 
-	pages = kz_bookmark_get_children(tab);
-	cur_page = KZ_BOOKMARK(g_list_nth_data(pages, cur_pos));
-	g_list_free(pages);
-
-	new = kz_bookmark_new_with_attrs(cur_page ? kz_bookmark_get_title(cur_page) : "",
-					 cur_page ? kz_bookmark_get_link(cur_page) : "",
+	new = kz_bookmark_new_with_attrs(current_page ? kz_bookmark_get_title(current_page) : "",
+					 current_page ? kz_bookmark_get_link(current_page) : "",
 					 NULL);
 	return new;
 }



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