gtk+ r21410 - in trunk: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21410 - in trunk: . gtk
- Date: Wed, 17 Sep 2008 15:07:32 +0000 (UTC)
Author: matthiasc
Date: Wed Sep 17 15:07:32 2008
New Revision: 21410
URL: http://svn.gnome.org/viewvc/gtk+?rev=21410&view=rev
Log:
2008-09-17 Matthias Clasen <mclasen redhat com>
Bug 551722 â gtk_widget_set_scroll_adjustments() should check the
signal signature
* gtk/gtkwidget.c (gtk_widget_set_scroll_adjustments): Check the
signature of the signal. Patch by Christian Persch
Modified:
trunk/ChangeLog
trunk/gtk/gtkwidget.c
Modified: trunk/gtk/gtkwidget.c
==============================================================================
--- trunk/gtk/gtkwidget.c (original)
+++ trunk/gtk/gtkwidget.c Wed Sep 17 15:07:32 2008
@@ -4800,22 +4800,35 @@
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
+ guint signal_id;
+ GSignalQuery query;
+
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+
if (hadjustment)
g_return_val_if_fail (GTK_IS_ADJUSTMENT (hadjustment), FALSE);
if (vadjustment)
g_return_val_if_fail (GTK_IS_ADJUSTMENT (vadjustment), FALSE);
- if (WIDGET_CLASS (widget)->set_scroll_adjustments_signal)
+ signal_id = WIDGET_CLASS (widget)->set_scroll_adjustments_signal;
+ if (!signal_id)
+ return FALSE;
+
+ g_signal_query (signal_id, &query);
+ if (!query.signal_id ||
+ !g_type_is_a (query.itype, GTK_TYPE_WIDGET) ||
+ query.return_type != G_TYPE_NONE ||
+ query.n_params != 2 ||
+ query.param_types[0] != GTK_TYPE_ADJUSTMENT ||
+ query.param_types[1] != GTK_TYPE_ADJUSTMENT)
{
- /* FIXME: we should eventually check the signals signature here */
- g_signal_emit (widget,
- WIDGET_CLASS (widget)->set_scroll_adjustments_signal, 0,
- hadjustment, vadjustment);
- return TRUE;
+ g_warning (G_STRLOC ": signal \"%s::%s\" has wrong signature",
+ G_OBJECT_TYPE_NAME (widget), query.signal_name);
+ return FALSE;
}
- else
- return FALSE;
+
+ g_signal_emit (widget, signal_id, 0, hadjustment, vadjustment);
+ return TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]