From: Christian Dywan Date: Fri, 29 Jan 2010 20:10:05 +0000 (+0100) Subject: Move throbber class declarations to the beginning of the function X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9785317a888aea7524a3e89f3fe9d263344503c0;p=midori Move throbber class declarations to the beginning of the function --- diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index 0698ccb0..e6ab7df3 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -108,15 +108,20 @@ katze_throbber_timeout_destroy (KatzeThrobber* throbber); static void katze_throbber_class_init (KatzeThrobberClass* class) { - GObjectClass* gobject_class = G_OBJECT_CLASS (class); + GObjectClass* gobject_class; + GtkObjectClass* object_class; + GtkWidgetClass* widget_class; + GParamFlags flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT; + + gobject_class = G_OBJECT_CLASS (class); gobject_class->dispose = katze_throbber_dispose; gobject_class->set_property = katze_throbber_set_property; gobject_class->get_property = katze_throbber_get_property; - GtkObjectClass* object_class = GTK_OBJECT_CLASS (class); + object_class = GTK_OBJECT_CLASS (class); object_class->destroy = katze_throbber_destroy; - GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (class); + widget_class = GTK_WIDGET_CLASS (class); widget_class->realize = katze_throbber_realize; widget_class->unrealize = katze_throbber_unrealize; widget_class->map = katze_throbber_map; @@ -126,8 +131,6 @@ katze_throbber_class_init (KatzeThrobberClass* class) widget_class->size_request = katze_throbber_size_request; widget_class->expose_event = katze_throbber_expose_event; - GParamFlags flags = G_PARAM_READWRITE | G_PARAM_CONSTRUCT; - g_object_class_install_property (gobject_class, PROP_ICON_SIZE, g_param_spec_int ( @@ -855,6 +858,8 @@ katze_throbber_expose_event (GtkWidget* widget, } else { + gint cols, rows; + if (G_UNLIKELY (throbber->icon_name && !throbber->pixbuf)) { icon_theme_changed (KATZE_THROBBER (widget)); @@ -868,8 +873,8 @@ katze_throbber_expose_event (GtkWidget* widget, } } - gint cols = gdk_pixbuf_get_width (throbber->pixbuf) / throbber->width; - gint rows = gdk_pixbuf_get_height (throbber->pixbuf) / throbber->height; + cols = gdk_pixbuf_get_width (throbber->pixbuf) / throbber->width; + rows = gdk_pixbuf_get_height (throbber->pixbuf) / throbber->height; if (G_UNLIKELY (cols == 1 && cols == rows)) {