[netspeed/unstable] Fix some small issues



commit 96726d0d4b1b81fd751cdbd18d44616f650c581a
Author: Jörgen Scheibengruber <mfcn gmx de>
Date:   Tue Jun 22 23:19:13 2010 +0300

    Fix some small issues

 src/netspeed.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/netspeed.c b/src/netspeed.c
index e4d9b42..d4a1ab1 100644
--- a/src/netspeed.c
+++ b/src/netspeed.c
@@ -240,29 +240,29 @@ applet_change_size_or_orient(PanelApplet *applet, int arg1, gpointer user_data)
  * the panel background.
  */
 static void 
-change_background_cb(PanelApplet *applet_widget, 
+change_background_cb(PanelApplet *applet,
 				PanelAppletBackgroundType type,
 				GdkColor *color, GdkPixmap *pixmap, 
-				NetspeedApplet *applet)
+				gpointer user_data)
 {
 	GtkStyle *style;
 	GtkRcStyle *rc_style = gtk_rc_style_new ();
-	gtk_widget_set_style (GTK_WIDGET (applet_widget), NULL);
-	gtk_widget_modify_style (GTK_WIDGET (applet_widget), rc_style);
+	gtk_widget_set_style (GTK_WIDGET (applet), NULL);
+	gtk_widget_modify_style (GTK_WIDGET (applet), rc_style);
 	gtk_rc_style_unref (rc_style);
 
 	switch (type) {
 		case PANEL_PIXMAP_BACKGROUND:
-			style = gtk_style_copy (GTK_WIDGET (applet_widget)->style);
+			style = gtk_style_copy (GTK_WIDGET (applet)->style);
 			if(style->bg_pixmap[GTK_STATE_NORMAL])
 				g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
 			style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
-			gtk_widget_set_style (GTK_WIDGET(applet_widget), style);
+			gtk_widget_set_style (GTK_WIDGET(applet), style);
 			g_object_unref (style);
 			break;
 
 		case PANEL_COLOR_BACKGROUND:
-			gtk_widget_modify_bg(GTK_WIDGET(applet_widget), GTK_STATE_NORMAL, color);
+			gtk_widget_modify_bg(GTK_WIDGET(applet), GTK_STATE_NORMAL, color);
 			break;
 
 		case PANEL_NO_BACKGROUND:
@@ -270,7 +270,6 @@ change_background_cb(PanelApplet *applet_widget,
 	}
 }
 
-
 /* Change the icons according to the selected device
  */
 static void
@@ -957,7 +956,6 @@ netspeed_init (Netspeed *self)
 	
 	/* Install shortcut */
 	self->priv = priv;
-	icon_theme = gtk_icon_theme_get_default();
 
 	gtk_widget_set_name (GTK_WIDGET(self), "PanelApplet");
 	
@@ -997,14 +995,15 @@ netspeed_init (Netspeed *self)
 	gtk_box_pack_start(GTK_BOX(spacer_box), priv->qual_pix, FALSE, FALSE, 0);
 	gtk_box_pack_start(GTK_BOX(spacer_box), priv->dev_pix, FALSE, FALSE, 0);
 
+	icon_theme = gtk_icon_theme_get_default();
 	g_signal_connect(G_OBJECT(icon_theme), "changed",
                            G_CALLBACK(icon_theme_changed_cb),
                            self);
 
 	g_signal_connect(G_OBJECT(self), "change_background",
                            G_CALLBACK(change_background_cb),
-			   (gpointer)applet);
-		       
+			   NULL);
+
 	g_signal_connect(G_OBJECT(priv->in_label), "size_request",
                            G_CALLBACK(label_size_request_cb),
                            self);
@@ -1056,7 +1055,7 @@ netspeed_finalize (GObject *object)
 
 	icon_theme = gtk_icon_theme_get_default();
 	g_object_disconnect(G_OBJECT(icon_theme), "any_signal::changed",
-						G_CALLBACK(icon_theme_changed_cb), (gpointer)priv->stuff,
+						G_CALLBACK(icon_theme_changed_cb), object,
 						NULL);
 
 	g_source_remove(priv->timeout_id);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]