Commit 4d4bedd1 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Added more debugging domains, enabled some long dornmant debug prints

parent b1d730a9
......@@ -590,19 +590,20 @@ glade_command_set_property_execute (GladeCommand *cmd)
else
g_value_copy (sdata->new_value, &new_value);
#if 0
{
gchar *str =
#ifdef GLADE_ENABLE_DEBUG
if (glade_get_debug_flags () & GLADE_DEBUG_COMMANDS)
{
gchar *str =
glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (pclass->handle), pclass, &new_value);
(glade_property_class_get_adaptor (pclass), pclass, &new_value);
g_print ("Setting %s property of %s to %s (sumode: %d)\n",
pclass->id,
glade_widget_get_name (widget),
str, glade_property_superuser ());
g_print ("Setting %s property of %s to %s (sumode: %d)\n",
glade_property_class_id (pclass),
glade_widget_get_name (widget),
str, glade_property_superuser ());
g_free (str);
}
g_free (str);
}
#endif
/* Packing properties need to be refreshed here since
......
......@@ -72,8 +72,11 @@ glade_setup_log_handlers ()
static GladeDebugFlag glade_debug_flags = 0;
static const GDebugKey glade_debug_keys[] = {
{ "ref-counts", GLADE_DEBUG_REF_COUNTS },
{ "widget-events", GLADE_DEBUG_WIDGET_EVENTS },
{ "commands", GLADE_DEBUG_COMMANDS },
{ "properties", GLADE_DEBUG_PROPERTIES },
{ "verify", GLADE_DEBUG_VERIFY }
};
......
......@@ -4,7 +4,11 @@
G_BEGIN_DECLS
typedef enum {
GLADE_DEBUG_VERIFY = (1 << 0)
GLADE_DEBUG_REF_COUNTS = (1 << 0),
GLADE_DEBUG_WIDGET_EVENTS = (1 << 1),
GLADE_DEBUG_COMMANDS = (1 << 2),
GLADE_DEBUG_PROPERTIES = (1 << 3),
GLADE_DEBUG_VERIFY = (1 << 4)
} GladeDebugFlag;
#ifdef GLADE_ENABLE_DEBUG
......
......@@ -305,28 +305,27 @@ glade_property_set_value_impl (GladeProperty * property, const GValue * value)
GValue old_value = { 0, };
gboolean warn_before, warn_after;
#if 0
{
g_print ("***************************************************\n");
g_print ("Setting %s property %s on %s ..\n",
property->priv->klass->packing ? "packing" : "normal",
property->priv->klass->id,
property->priv->widget ? property->priv->widget->name : "unknown");
gchar *str1 = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->priv->klass->handle),
property->priv->klass, property->priv->value);
gchar *str2 = glade_widget_adaptor_string_from_value
(GLADE_WIDGET_ADAPTOR (property->priv->klass->handle),
property->priv->klass, value);
g_print ("from %s to %s\n", str1, str2);
g_free (str1);
g_free (str2);
}
#endif
#ifdef GLADE_ENABLE_DEBUG
if (glade_get_debug_flags () & GLADE_DEBUG_PROPERTIES)
{
g_print ("PROPERTY: Setting %s property %s on %s ",
glade_property_class_get_is_packing (property->priv->klass) ? "packing" : "normal",
glade_property_class_id (property->priv->klass),
property->priv->widget ? glade_widget_get_name (property->priv->widget) : "unknown");
gchar *str1 =
glade_widget_adaptor_string_from_value (glade_property_class_get_adaptor (property->priv->klass),
property->priv->klass, property->priv->value);
gchar *str2 =
glade_widget_adaptor_string_from_value (glade_property_class_get_adaptor (property->priv->klass),
property->priv->klass, value);
g_print ("from %s to %s\n", str1, str2);
g_free (str1);
g_free (str2);
}
#endif /* GLADE_ENABLE_DEBUG */
if (!g_value_type_compatible
(G_VALUE_TYPE (property->priv->value), G_VALUE_TYPE (value)))
if (!g_value_type_compatible (G_VALUE_TYPE (property->priv->value), G_VALUE_TYPE (value)))
{
g_warning ("Trying to assign an incompatible value to property %s\n",
glade_property_class_id (property->priv->klass));
......
......@@ -541,10 +541,11 @@ glade_widget_event (GladeWidget * gwidget, GdkEvent * event)
handled = GLADE_WIDGET_GET_CLASS (gwidget)->event (gwidget, event);
#if 0
#ifdef GLADE_ENABLE_DEBUG
if (event->type != GDK_EXPOSE)
g_print ("event widget '%s' handled '%d' event '%d'\n",
gwidget->priv->name, handled, event->type);
GLADE_NOTE (WIDGET_EVENTS,
g_print ("event widget '%s' handled '%d' event '%d'\n",
gwidget->priv->name, handled, event->type));
#endif
return handled;
......@@ -957,10 +958,8 @@ glade_widget_finalize (GObject * object)
g_return_if_fail (GLADE_IS_WIDGET (object));
#if 0
/* A good way to check if refcounts are balancing at project close time */
g_print ("Finalizing widget %s\n", widget->priv->name);
#endif
GLADE_NOTE (REF_COUNTS,
g_print ("Finalizing widget %s\n", widget->priv->name));
g_free (widget->priv->name);
g_free (widget->priv->internal);
......@@ -1689,12 +1688,7 @@ glade_widget_extract_children (GladeWidget * gwidget)
{
GObject *child = G_OBJECT (list->data);
GladeWidget *gchild = glade_widget_get_from_gobject (child);
#if 0
g_print ("Extracting %s from %s\n",
gchild ? gchild->name :
GLADE_IS_PLACEHOLDER (child) ? "placeholder" : "unknown widget",
gwidget->priv->name);
#endif
if (gchild && gchild->priv->internal)
{
/* Recurse and collect any deep child hierarchies
......@@ -3438,12 +3432,11 @@ glade_widget_set_object (GladeWidget * gwidget, GObject * new_object)
{
if (gwidget->priv->internal == NULL)
{
#if _YOU_WANT_TO_LOOK_AT_PROJECT_REFCOUNT_BALANCING_
g_print ("Killing '%s::%s' widget's object with reference count %d\n",
glade_widget_adaptor_get_name (gwidget->priv->adaptor),
gwidget->priv->name ? gwidget->priv->name : "(unknown)",
old_object->ref_count);
#endif
GLADE_NOTE (REF_COUNTS,
g_print ("Killing '%s::%s' widget's object with reference count %d\n",
glade_widget_adaptor_get_name (gwidget->priv->adaptor),
gwidget->priv->name ? gwidget->priv->name : "(unknown)",
old_object->ref_count));
/* Have the adaptor for this widget break any additional references */
glade_widget_adaptor_destroy_object (gwidget->priv->adaptor, old_object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment