]> Pileus Git - ~andy/gtk/commitdiff
Fire a warning if there are any handlers connected to the deprecated "size-request...
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Thu, 28 Oct 2010 07:00:19 +0000 (16:00 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Sat, 30 Oct 2010 08:35:22 +0000 (17:35 +0900)
gtk/gtksizerequest.c
gtk/gtkwidget.c

index 9b467b429e17abf1730fb44bd10909224ad511fa..ba94aebab67e94a4dc316daf77aeb43dbf581dd0 100644 (file)
@@ -104,6 +104,8 @@ get_cached_size (SizeRequestCache  *cache,
   return FALSE;
 }
 
+
+extern guint size_request_signal_id;
 static void
 do_size_request (GtkWidget      *widget,
                 GtkRequisition *requisition)
@@ -115,6 +117,11 @@ do_size_request (GtkWidget      *widget,
               "will be removed in the next release",
               G_OBJECT_TYPE_NAME (widget));
 
+  if (g_signal_has_handler_pending (widget, size_request_signal_id, 0, TRUE))
+    g_warning ("A %s (%p) has handler(s) connected to the GtkWidgetClass::size-request signal which is "
+              "deprecated and will be removed in the next release",
+              G_OBJECT_TYPE_NAME (widget), widget);
+
   /* Now we dont bother caching the deprecated "size-request" returns,
    * just unconditionally invoke here just in case we run into legacy stuff */
   gtk_widget_ensure_style (widget);
index b37452f7ad10d889af054f6462315de10be9de86..34cf229d14019d7b9c1a2db12b0baeae7e10b6ec 100644 (file)
@@ -710,6 +710,9 @@ static guint            composite_child_stack = 0;
 static GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
 static GParamSpecPool  *style_property_spec_pool = NULL;
 
+/* XXX Temporarily here to fire warnings from gtksizerequest.c */
+guint size_request_signal_id = 0;
+
 static GQuark          quark_property_parser = 0;
 static GQuark          quark_aux_info = 0;
 static GQuark          quark_accel_path = 0;
@@ -1467,7 +1470,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @widget: the object which received the signal.
    * @requisition:
    */
-  widget_signals[SIZE_REQUEST] =
+  size_request_signal_id = widget_signals[SIZE_REQUEST] =
     g_signal_new (I_("size-request"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,