Fixed assertions from setting "tooltip-text" to NULL (bug 452425)

* gtk/gtkwidget.c: Fixed assertions from setting "tooltip-text" to NULL
	(bug 452425)


svn path=/trunk/; revision=18353
This commit is contained in:
Tristan Van Berkom 2007-07-03 15:39:59 +00:00
parent d953125970
commit 12bdfb430e
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-07-03 Tristan Van Berkom <tvb@gnome.org>
* gtk/gtkwidget.c: Fixed assertions from setting "tooltip-text" to NULL
(bug 452425)
2007-07-03 Johan Dahlin <jdahlin@async.com.br>
* gtk/gtk-builder-convert (GtkBuilderConverter._strip_root): Add a

View File

@ -1948,6 +1948,7 @@ gtk_widget_set_property (GObject *object,
gboolean tmp;
guint32 saved_flags;
gchar *tooltip_markup;
const gchar *tooltip_text;
GtkWindow *tooltip_window;
case PROP_NAME:
@ -2038,12 +2039,14 @@ gtk_widget_set_property (GObject *object,
break;
case PROP_TOOLTIP_TEXT:
tooltip_window = g_object_get_qdata (object, quark_tooltip_window);
tooltip_markup = g_markup_escape_text (g_value_get_string (value), -1);
tooltip_text = g_value_get_string (value);
tooltip_markup = tooltip_text ? g_markup_escape_text (tooltip_text, -1) : NULL;
g_object_set_qdata_full (object, quark_tooltip_markup,
tooltip_markup, g_free);
gtk_widget_set_has_tooltip (widget, TRUE, FALSE);
tmp = (tooltip_window != NULL || tooltip_markup != NULL);
gtk_widget_set_has_tooltip (widget, tmp, FALSE);
break;
default:
break;