After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572355 - Remove deprecated GTK+ symbols
Remove deprecated GTK+ symbols
Product: gnome-system-tools
Classification: Deprecated
Component: general
CVS latest
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
Carlos Garnacho
Depends on: 570952
Blocks: 585692
Reported: 2009-02-19 00:41 UTC by André Klapper
Modified: 2009-11-07 20:28 UTC
See Also:
GNOME target: ---
GNOME version: ---

Replace GTK_CHECK_* with G_TYPE_* equivalents (6.60 KB, patch)
2009-02-24 22:23 UTC, Thomas Andersen
committed Details | Review
Replace deprecated gtk symbols (9.30 KB, patch)
2009-02-25 21:06 UTC, Thomas Andersen
committed Details | Review
Replace deprecated gtk symbols in Users and Time (1.58 KB, patch)
2009-04-27 18:24 UTC, Thomas Andersen
committed Details | Review
Replace deprecated gtk symbols in Boot (1.62 KB, patch)
2009-04-27 18:40 UTC, Thomas Andersen
committed Details | Review

Description André Klapper 2009-02-19 00:41:13 UTC

For potential patch contributors:
It might make sense to break this into several smaller patches. :-P
Also make sure that the gtk and glib versions in are high enough
and take a look since which version the new non-deprecated functions are
available. is your friend.

Complete list:
GTK_CHECK_CAST, GTK_CHECK_CLASS_CAST, GTK_CHECK_CLASS_TYPE, GTK_CHECK_TYPE, GtkType, gdk_cursor_destroy, gdk_gc_unref, gdk_pixbuf_unref, gtk_item_factory_create_items, gtk_item_factory_new, gtk_item_factory_popup, gtk_item_factory_set_translate_func, gtk_label_get, gtk_object_sink, gtk_object_unref, gtk_signal_emit, gtk_signal_emit_by_name, gtk_timeout_add, gtk_type_class, gtk_widget_ref, gtk_window_set_policy

$:andre\> grep -r GTK_CHECK_CAST .
./src/services/services-tool.h:#define GST_SERVICES_TOOL(obj)            (GTK_CHECK_CAST ((obj), GST_TYPE_SERVICES_TOOL, GstServicesTool))
./src/users/search-bar/search-bar.h:#define SEARCH_BAR(obj)			(GTK_CHECK_CAST ((obj), SEARCH_BAR_TYPE, SearchBar))
./src/users/users-tool.h:#define GST_USERS_TOOL(obj)            (GTK_CHECK_CAST ((obj), GST_TYPE_USERS_TOOL, GstUsersTool))
./src/time/e-map/e-map.h:#define E_MAP(obj)            (GTK_CHECK_CAST ((obj), TYPE_E_MAP, EMap))
./src/time/time-tool.h:#define GST_TIME_TOOL(obj)            (GTK_CHECK_CAST ((obj), GST_TYPE_TIME_TOOL, GstTimeTool))
./src/boot/boot-druid.h:#define BOOT_DRUID(o)          (GTK_CHECK_CAST ((o), BOOT_DRUID_TYPE, BootDruid))

$:andre\> grep -r GTK_CHECK_CLASS_CAST .
./src/services/services-tool.h:#define GST_SERVICES_TOOL_CLASS(class)    (GTK_CHECK_CLASS_CAST ((class), GST_TYPE_SERVICES_TOOL, GstServicesToolClass))
./src/users/search-bar/search-bar.h:#define SEARCH_BAR_CLASS(klass)		(GTK_CHECK_CLASS_CAST ((klass), SEARCH_BAR_TYPE, SearchBarClass))
./src/users/users-tool.h:#define GST_USERS_TOOL_CLASS(class)    (GTK_CHECK_CLASS_CAST ((class), GST_TYPE_USERS_TOOL, GstUsersToolClass))
./src/time/e-map/e-map.h:#define E_MAP_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), TYPE_E_MAP, EMapClass))
./src/time/time-tool.h:#define GST_TIME_TOOL_CLASS(class)    (GTK_CHECK_CLASS_CAST ((class), GST_TYPE_TIME_TOOL, GstTimeToolClass))
./src/boot/boot-druid.h:#define BOOT_DRUID_CLASS(k)    (GTK_CHECK_CLASS_CAST((k), BOOT_DRUID_TYPE, BootDruidClass))

$:andre\> grep -r GTK_CHECK_CLASS_TYPE .
./src/services/services-tool.h:#define GST_IS_SERVICES_TOOL_CLASS(class) (GTK_CHECK_CLASS_TYPE ((class), GST_TYPE_SERVICES_TOOL))
./src/users/search-bar/search-bar.h:#define IS_SEARCH_BAR_CLASS(klass)	(GTK_CHECK_CLASS_TYPE ((obj), SEARCH_BAR_TYPE))
./src/users/users-tool.h:#define GST_IS_USERS_TOOL_CLASS(class) (GTK_CHECK_CLASS_TYPE ((class), GST_TYPE_USERS_TOOL))
./src/time/e-map/e-map.h:#define IS_E_MAP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_E_MAP))
./src/time/time-tool.h:#define GST_IS_TIME_TOOL_CLASS(class) (GTK_CHECK_CLASS_TYPE ((class), GST_TYPE_TIME_TOOL))
./src/boot/boot-druid.h:#define BOOT_IS_DRUID_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BOOT_DRUID_TYPE))

$:andre\> grep -r GTK_CHECK_TYPE .
./src/services/services-tool.h:#define GST_IS_SERVICES_TOOL(obj)         (GTK_CHECK_TYPE ((obj), GST_TYPE_SERVICES_TOOL))
./src/users/search-bar/search-bar.h:#define IS_SEARCH_BAR(obj)		(GTK_CHECK_TYPE ((obj), SEARCH_BAR_TYPE))
./src/users/users-tool.h:#define GST_IS_USERS_TOOL(obj)         (GTK_CHECK_TYPE ((obj), GST_TYPE_USERS_TOOL))
./src/time/e-map/e-map.h:#define IS_E_MAP(obj)         (GTK_CHECK_TYPE ((obj), TYPE_E_MAP))
./src/time/time-tool.h:#define GST_IS_TIME_TOOL(obj)         (GTK_CHECK_TYPE ((obj), GST_TYPE_TIME_TOOL))
./src/boot/boot-druid.h:#define BOOT_IS_DRUID(o)       (GTK_CHECK_TYPE ((o), BOOT_DRUID_TYPE))

$:andre\> grep -r GtkType .
./src/users/search-bar/search-bar.h:GtkType    search_bar_get_type   (void);
./src/time/e-map/e-map.c:	static GtkType e_map_type = 0;
./src/time/e-map/e-map.h:GtkType e_map_get_type (void);
./src/boot/boot-druid.c:	static GtkType type = 0;
./src/boot/boot-druid.h:GtkType boot_druid_get_type (void);

$:andre\> grep -r gdk_cursor_destroy .
./src/disks/callbacks.c:  gdk_cursor_destroy (cursor);
./src/disks/callbacks.c:  gdk_cursor_destroy (cursor);

$:andre\> grep -r gdk_gc_unref .
./src/time/e-map/e-map.c:	gdk_gc_unref (gc);
./src/time/e-map/e-map.c:	gdk_gc_unref (gc);

$:andre\> grep -r gdk_pixbuf_unref .
./src/time/e-map/e-map.c:	gdk_pixbuf_unref (priv->map_pixbuf);
./src/time/e-map/e-map.c:	gdk_pixbuf_unref (priv->map_render_pixbuf);
./src/time/e-map/e-map.c:	if (priv->map_pixbuf) gdk_pixbuf_unref (priv->map_pixbuf);
./src/time/e-map/e-map.c:	if (priv->map_render_pixbuf) gdk_pixbuf_unref (priv->map_render_pixbuf);
./src/shares/share-nfs-add-hosts.c:	gdk_pixbuf_unref (pixbuf);
./src/common/gst-tool.c:		gdk_pixbuf_unref (pixbuf);

$:andre\> grep -r gtk_item_factory_create_items .
./src/disks/disks-gui.c:	gtk_item_factory_create_items (item_factory, G_N_ELEMENTS (popup_partition_menu_items),

$:andre\> grep -r gtk_item_factory_new .
./src/disks/disks-gui.c:	item_factory = gtk_item_factory_new (GTK_TYPE_MENU, "<main>", NULL);

$:andre\> grep -r gtk_item_factory_popup .
./src/disks/callbacks.c:	gtk_item_factory_popup (factory, event->x_root, event->y_root,

$:andre\> grep -r gtk_item_factory_set_translate_func .
./src/disks/disks-gui.c:	gtk_item_factory_set_translate_func (item_factory, disks_partition_item_factory_trans,

$:andre\> grep -r gtk_label_get .
./src/time/tz-map.c:	gtk_label_get (GTK_LABEL (((GstTimeTool *) tzmap->tool)->map_hover_label), &old_zone);

$:andre\> grep -r gtk_object_sink .
./src/time/e-map/e-map.c:	gtk_object_sink (GTK_OBJECT (priv->hadj));
./src/time/e-map/e-map.c:	gtk_object_sink (GTK_OBJECT (priv->vadj));

$:andre\> grep -r gtk_object_unref .
./src/time/e-map/e-map.c:	gtk_object_unref (GTK_OBJECT (priv->hadj));
./src/time/e-map/e-map.c:	gtk_object_unref (GTK_OBJECT (priv->vadj));

$:andre\> grep -r gtk_signal_emit .
./src/users/search-bar/search-bar.c:	gtk_signal_emit(GTK_OBJECT (sb), sb_signals [QUERY_CHANGED]);

$:andre\> grep -r gtk_signal_emit_by_name .
./src/time/e-map/e-map.c:	gtk_signal_emit_by_name (GTK_OBJECT (priv->hadj), "changed");
./src/time/e-map/e-map.c:	gtk_signal_emit_by_name (GTK_OBJECT (priv->vadj), "changed");

$:andre\> grep -r gtk_timeout_add .
./src/time/e-map/e-map-test.c:	id = gtk_timeout_add(100, flash, NULL);

$:andre\> grep -r gtk_type_class .
./src/users/search-bar/search-bar.c:	parent_class = gtk_type_class (gtk_hbox_get_type ());
./src/time/e-map/e-map.c:	parent_class = gtk_type_class (GTK_TYPE_WIDGET);
./src/boot/boot-druid.c:	parent_class = gtk_type_class (gtk_window_get_type ());

$:andre\> grep -r gtk_widget_ref .
./src/common/gst-dialog.c:	gtk_widget_ref (priv->child);

$:andre\> grep -r gtk_window_set_policy .
./src/boot/callbacks.c:	gtk_window_set_policy (GTK_WINDOW (editor->dialog), FALSE, TRUE, TRUE);
./src/boot/callbacks.c:	gtk_window_set_policy (GTK_WINDOW (editor->dialog), FALSE, TRUE, TRUE);
Comment 1 Thomas Andersen 2009-02-19 02:08:21 UTC
There is a patch for the gdk_pixbuf symbols in bug #570952
Comment 2 André Klapper 2009-02-24 19:20:43 UTC
g-s-t is unmaintained:
Comment 3 André Klapper 2009-02-24 19:35:06 UTC
Ah hmm. For more complicated stuff we should branch probably.
Comment 4 André Klapper 2009-02-24 19:37:50 UTC
currently it's
Comment 6 Thomas Andersen 2009-02-24 22:23:55 UTC
Created attachment 129431 [details] [review]
Replace GTK_CHECK_* with G_TYPE_* equivalents

Another fairly trivial change
Comment 7 André Klapper 2009-02-24 23:21:53 UTC
I'd say just commit...
Comment 8 Thomas Andersen 2009-02-25 01:08:04 UTC
ok. Committed as r4301:
Comment 9 Thomas Andersen 2009-02-25 21:06:57 UTC
Created attachment 129519 [details] [review]
Replace deprecated gtk symbols

Replaces more deprecated stuff. There are still a few left but this is all for tonight
Comment 10 Thomas Andersen 2009-02-25 22:04:26 UTC
Committed the patch as r4303:
Comment 11 André Klapper 2009-03-31 12:12:08 UTC
Deprecated symbols that are still left:
./src/users/search-bar/search-bar.c:    gtk_signal_emit(GTK_OBJECT (sb),
sb_signals [QUERY_CHANGED]);
./src/time/e-map/e-map.c:       gtk_signal_emit_by_name (GTK_OBJECT
(priv->hadj), "changed");
./src/time/e-map/e-map.c:       gtk_signal_emit_by_name (GTK_OBJECT
(priv->vadj), "changed");
./src/boot/callbacks.c: gtk_window_set_policy (GTK_WINDOW (editor->dialog),
./src/boot/callbacks.c: gtk_window_set_policy (GTK_WINDOW (editor->dialog),
Comment 12 Frederic Peters 2009-04-18 12:44:18 UTC
Thomas, are you interested in handling those few remaining symbols?
Comment 13 Thomas Andersen 2009-04-27 18:24:48 UTC
Created attachment 133434 [details] [review]
Replace deprecated gtk symbols in Users and Time

Replaces the gtk_signal* stuff in Time and Users.
Comment 14 Thomas Andersen 2009-04-27 18:40:33 UTC
Created attachment 133439 [details] [review]
Replace deprecated gtk symbols in Boot

Replaces gtk_window_set_policy with gtk_window_set_resizable.

The code in /src/boot is unused and not even built. From the looks of the old code I assume the intention was to make the window not resizable.
Comment 15 André Klapper 2009-04-27 18:52:32 UTC
Shweet. Branch and commit, I'd say?
Comment 16 Thomas Andersen 2009-04-27 23:06:38 UTC
André do you mean to branch off 2.22.x and prepare for a 2.28 release? 2.22.2 is already tagged and the post-release bump has been made to 2.22.3. I suppose I could just commit?
Comment 17 André Klapper 2009-04-27 23:31:52 UTC
If you think it's safe enough to commit to the stable series, go ahead.
You know best.
I agree it's no huge changes, it's just that I'm a bit conservative when it comes to fixing non-serious issues in a stable release series. ;-)
Comment 18 André Klapper 2009-04-27 23:34:22 UTC
> The code in /src/boot is unused and not even built.

Thomas: Is there a good reason that we keep it? Wondering because dropping it would also fix bug 571234.
Comment 19 Thomas Andersen 2009-04-28 00:23:10 UTC
I'll branch 2.22 and commit it to master.

IMO it should just be deleted. But then I think all dead code should be deleted. We have VCS so we can always bring it back. I just fixed it because I am not sure if it is patched back in for some distros.
Comment 21 André Klapper 2009-11-07 18:52:09 UTC
Moving targets are evil... So we got a new function to get rid of:
gdk_event_get_graphics_expose() has been deprecated lately.

$:andre\> grep -r gdk_event_get_graphics_expose .
./src/time/e-map/e-map.c:	while ((event = gdk_event_get_graphics_expose (window)) != NULL)

As this is code copied from Evolution you want to copy the patch:
Comment 22 Milan Bouchet-Valat 2009-11-07 20:28:13 UTC
What would we do without you? :-)
Pushed as e1938f9 - even if the comments in the patch aren't that reassuring about its effects... Anyway, Robert Ancell from Canonical said he wanted to replace it with an improved widget taken from Ubuntu's installer, and upstream that. Hope we'll have got rid of EMap by the next release.