remove quark_user_data usage in gtk_object_{g|s}et_user_data(). fixes

Fri Feb  7 04:49:46 2003  Tim Janik  <timj@gtk.org>

        * gtk/gtkobject.c: remove quark_user_data usage in
        gtk_object_{g|s}et_user_data(). fixes get_user_data()
        returning NULL for user_data set through property interface.

        * gtk/gtkitemfactory.c (gtk_item_factory_create_item): don't put out
        warnings if a pixbuf couldn't be retrieved, since (a) this doesn't
        need to be a programming error (in case of loaded data), (b) it breaks
        with 2.0 behaviour where extra magic could be used to create empty
        images. don't attempt to retrieve pixbufs from NULL extra_data.
This commit is contained in:
Tim Janik 2003-02-07 03:53:20 +00:00 committed by Tim Janik
parent f683ed9a0a
commit 10d67ceb23
7 changed files with 69 additions and 18 deletions

View File

@ -1,3 +1,15 @@
Fri Feb 7 04:49:46 2003 Tim Janik <timj@gtk.org>
* gtk/gtkobject.c: remove quark_user_data usage in
gtk_object_{g|s}et_user_data(). fixes get_user_data()
returning NULL for user_data set through property interface.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): don't put out
warnings if a pixbuf couldn't be retrieved, since (a) this doesn't
need to be a programming error (in case of loaded data), (b) it breaks
with 2.0 behaviour where extra magic could be used to create empty
images. don't attempt to retrieve pixbufs from NULL extra_data.
2003-02-06 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkvisual-x11.c (gdk_visual_get_best_with_depth): Return

View File

@ -1,3 +1,15 @@
Fri Feb 7 04:49:46 2003 Tim Janik <timj@gtk.org>
* gtk/gtkobject.c: remove quark_user_data usage in
gtk_object_{g|s}et_user_data(). fixes get_user_data()
returning NULL for user_data set through property interface.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): don't put out
warnings if a pixbuf couldn't be retrieved, since (a) this doesn't
need to be a programming error (in case of loaded data), (b) it breaks
with 2.0 behaviour where extra magic could be used to create empty
images. don't attempt to retrieve pixbufs from NULL extra_data.
2003-02-06 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkvisual-x11.c (gdk_visual_get_best_with_depth): Return

View File

@ -1,3 +1,15 @@
Fri Feb 7 04:49:46 2003 Tim Janik <timj@gtk.org>
* gtk/gtkobject.c: remove quark_user_data usage in
gtk_object_{g|s}et_user_data(). fixes get_user_data()
returning NULL for user_data set through property interface.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): don't put out
warnings if a pixbuf couldn't be retrieved, since (a) this doesn't
need to be a programming error (in case of loaded data), (b) it breaks
with 2.0 behaviour where extra magic could be used to create empty
images. don't attempt to retrieve pixbufs from NULL extra_data.
2003-02-06 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkvisual-x11.c (gdk_visual_get_best_with_depth): Return

View File

@ -1,3 +1,15 @@
Fri Feb 7 04:49:46 2003 Tim Janik <timj@gtk.org>
* gtk/gtkobject.c: remove quark_user_data usage in
gtk_object_{g|s}et_user_data(). fixes get_user_data()
returning NULL for user_data set through property interface.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): don't put out
warnings if a pixbuf couldn't be retrieved, since (a) this doesn't
need to be a programming error (in case of loaded data), (b) it breaks
with 2.0 behaviour where extra magic could be used to create empty
images. don't attempt to retrieve pixbufs from NULL extra_data.
2003-02-06 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkvisual-x11.c (gdk_visual_get_best_with_depth): Return

View File

@ -1,3 +1,15 @@
Fri Feb 7 04:49:46 2003 Tim Janik <timj@gtk.org>
* gtk/gtkobject.c: remove quark_user_data usage in
gtk_object_{g|s}et_user_data(). fixes get_user_data()
returning NULL for user_data set through property interface.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): don't put out
warnings if a pixbuf couldn't be retrieved, since (a) this doesn't
need to be a programming error (in case of loaded data), (b) it breaks
with 2.0 behaviour where extra magic could be used to create empty
images. don't attempt to retrieve pixbufs from NULL extra_data.
2003-02-06 Matthias Clasen <maclas@gmx.de>
* gdk/x11/gdkvisual-x11.c (gdk_visual_get_best_with_depth): Return

View File

@ -1076,22 +1076,17 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
gtk_radio_menu_item_set_group (GTK_RADIO_MENU_ITEM (widget), radio_group);
if (type_id == quark_type_image_item)
{
GError *error = NULL;
GdkPixbuf *pixbuf = NULL;
image = NULL;
pixbuf = gdk_pixbuf_new_from_inline (-1,
entry->extra_data,
FALSE,
&error);
if (pixbuf)
image = gtk_image_new_from_pixbuf (pixbuf);
else
if (entry->extra_data)
{
g_warning ("Error loading menu image: %s", error->message);
g_error_free (error);
pixbuf = gdk_pixbuf_new_from_inline (-1,
entry->extra_data,
FALSE,
NULL);
if (pixbuf)
image = gtk_image_new_from_pixbuf (pixbuf);
}
if (image)
{
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image);

View File

@ -63,7 +63,6 @@ static void gtk_object_notify_weaks (GtkObject *object);
static gpointer parent_class = NULL;
static guint object_signals[LAST_SIGNAL] = { 0 };
static GQuark quark_user_data = 0;
static GQuark quark_weakrefs = 0;
@ -717,10 +716,7 @@ gtk_object_set_user_data (GtkObject *object,
{
g_return_if_fail (GTK_IS_OBJECT (object));
if (!quark_user_data)
quark_user_data = g_quark_from_static_string ("user_data");
g_datalist_id_set_data (&G_OBJECT (object)->qdata, quark_user_data, data);
g_object_set_data (G_OBJECT (object), "user_data", data);
}
gpointer
@ -728,7 +724,7 @@ gtk_object_get_user_data (GtkObject *object)
{
g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
return g_datalist_id_get_data (&G_OBJECT (object)->qdata, quark_user_data);
return g_object_get_data (G_OBJECT (object), "user_data");
}
GtkObject*