[kazehakase-svn] [3552] * src/kz-tab-label.[ch]: Remove kz_tab_label_show_favicon.

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
Sat Jan 24 17:03:04 JST 2009


Revision: 3552
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3552
Author:   ikezoe
Date:     2009-01-24 17:03:04 +0900 (Sat, 24 Jan 2009)

Log Message:
-----------
	* src/kz-tab-label.[ch]: Remove kz_tab_label_show_favicon. KzTab now
	handles favicon internally.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/kz-tab-label.c
    kazehakase/trunk/src/kz-tab-label.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-01-24 07:58:30 UTC (rev 3551)
+++ kazehakase/trunk/ChangeLog	2009-01-24 08:03:04 UTC (rev 3552)
@@ -4,6 +4,8 @@
 	* src/bookmarks/kz-bookmark.c: Use g_object_set_qdata instead of
 	g_object_set.
 	* src/kz-tab-label.[ch]: Remove favicon_pixbuf from KzTab structure.
+	* src/kz-tab-label.[ch]: Remove kz_tab_label_show_favicon. KzTab now
+	handles favicon internally.
 
 2009-01-23  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/src/kz-tab-label.c
===================================================================
--- kazehakase/trunk/src/kz-tab-label.c	2009-01-24 07:58:30 UTC (rev 3551)
+++ kazehakase/trunk/src/kz-tab-label.c	2009-01-24 08:03:04 UTC (rev 3552)
@@ -51,6 +51,7 @@
 	gboolean lock;
 	gboolean auto_refresh;
 	gboolean javascript;
+	gboolean show_favicon;
 	guint auto_refresh_id;
 	gulong favicon_signal;
 	gint icon_width;
@@ -208,6 +209,9 @@
 	priv->auto_refresh_id   = 0;
 	priv->favicon_signal    = 0;
 	
+	/* favicon */
+	KZ_CONF_GET("Tab", "show_favicon", priv->show_favicon, BOOL);
+
 	kztab->circle           = NULL;
 	kztab->mask             = NULL;
 
@@ -575,30 +579,6 @@
         g_object_set(kztab->lock_button, "visible", show, NULL);
 }
 
-
-void
-kz_tab_label_set_show_favicon (KzTabLabel *kztab, gboolean show)
-{
-	g_return_if_fail(KZ_IS_TAB_LABEL(kztab));
-
-	if (show && kztab->kzembed)
-	{
-		const gchar *uri;
-		GdkPixbuf *favicon_pixbuf;
-
-		uri = kz_embed_get_location(KZ_EMBED(kztab->kzembed));
-		favicon_pixbuf = kz_favicon_get_pixbuf(KZ_GET_FAVICON, uri,
-						       GTK_ICON_SIZE_MENU);
-		gtk_image_set_from_pixbuf(GTK_IMAGE(kztab->favicon),
-					  favicon_pixbuf);
-		if (favicon_pixbuf)
-			g_object_unref(favicon_pixbuf);
-	}
-
-        g_object_set(kztab->favicon, "visible", show, NULL);
-}
-
-
 static void
 realize (GtkWidget *widget)
 {
@@ -742,7 +722,6 @@
 	gint width = 80;
 	gboolean fix = TRUE;
 	gboolean show_close = TRUE;
-	gboolean show_favicon = TRUE;
 	gchar *color;
 	KzTabLabelPrivate *priv = KZ_TAB_LABEL_GET_PRIVATE (kztab);
 
@@ -762,10 +741,6 @@
 	/* lock button */
 	kz_tab_label_set_show_lock_button(kztab, priv->lock);
 
-	/* favicon */
-	KZ_CONF_GET("Tab", "show_favicon", show_favicon, BOOL);
-	kz_tab_label_set_show_favicon(kztab, show_favicon);
-
 	/* label color */
 	color = KZ_CONF_GET_STR("Tab" , "normal_color");
 	if (!color)
@@ -856,7 +831,16 @@
 {
 	g_return_if_fail(KZ_IS_TAB_LABEL(kztab));
 
-	kz_tab_label_sync_to_profile (kztab);
+	if (key && strcmp(key, "show_favicon"))
+	{
+		KzTabLabelPrivate *priv = KZ_TAB_LABEL_GET_PRIVATE(kztab);
+		KZ_CONF_GET("Tab", "show_favicon", priv->show_favicon, BOOL);
+		if (priv->show_favicon)
+			gtk_widget_show(kztab->favicon);
+		else
+			gtk_widget_hide(kztab->favicon);
+	}
+	kz_tab_label_sync_to_profile(kztab);
 }
 
 /* callbacks for embed */
@@ -908,7 +892,7 @@
 cb_net_stop (KzEmbed *embed, KzTabLabel *kztab)
 {
 	KzNotebook *note;
-	gboolean show_favicon;
+	KzTabLabelPrivate *priv = KZ_TAB_LABEL_GET_PRIVATE(kztab);
 
 	g_return_if_fail(KZ_IS_TAB_LABEL(kztab));
 
@@ -942,8 +926,19 @@
 			kz_tab_label_set_state(kztab, KZ_TAB_LABEL_STATE_LOADED);
 	}
 
-	KZ_CONF_GET("Tab", "show_favicon", show_favicon, BOOL);
-	kz_tab_label_set_show_favicon(kztab, show_favicon);
+	if (priv->show_favicon)
+	{
+		const gchar *uri;
+		GdkPixbuf *favicon_pixbuf;
+
+		uri = kz_embed_get_location(KZ_EMBED(kztab->kzembed));
+		favicon_pixbuf = kz_favicon_get_pixbuf(KZ_GET_FAVICON, uri,
+						       GTK_ICON_SIZE_MENU);
+		gtk_image_set_from_pixbuf(GTK_IMAGE(kztab->favicon),
+					  favicon_pixbuf);
+		if (favicon_pixbuf)
+			g_object_unref(favicon_pixbuf);
+	}
 }
 
 
@@ -1103,7 +1098,7 @@
 
 	g_return_if_fail(KZ_IS_TAB_LABEL(kztab));
 	priv = KZ_TAB_LABEL_GET_PRIVATE (kztab);
-	if(auto_refresh)
+	if (auto_refresh)
 	{
 		gint auto_refresh_interval_sec = DEFAULT_AUTO_REFRESH_INTERVAL_SEC;
 		KZ_CONF_GET("Tab", "auto_refresh_interval_sec", auto_refresh_interval_sec, INT);

Modified: kazehakase/trunk/src/kz-tab-label.h
===================================================================
--- kazehakase/trunk/src/kz-tab-label.h	2009-01-24 07:58:30 UTC (rev 3551)
+++ kazehakase/trunk/src/kz-tab-label.h	2009-01-24 08:03:04 UTC (rev 3552)
@@ -91,8 +91,6 @@
 void             kz_tab_label_set_show_lock_button
 						(KzTabLabel *kztab,
 						 gboolean    show);
-void             kz_tab_label_set_show_favicon  (KzTabLabel *kztab,
-						 gboolean    show);
 
 gboolean         kz_tab_label_get_lock          (KzTabLabel *kztab);
 void             kz_tab_label_set_lock          (KzTabLabel *kztab,



More information about the Kazehakase-cvs mailing list
アーカイブの一覧に戻る