GNOME Bugzilla – Bug 572355
Remove deprecated GTK+ symbols
Last modified: 2009-11-07 20:28:13 UTC
http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B 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 configure.in are high enough and take a look since which version the new non-deprecated functions are available. http://library.gnome.org 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.c:GtkType ./src/users/search-bar/search-bar.h:GtkType search_bar_get_type (void); ./src/time/e-map/e-map.c:GtkType ./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:GtkType ./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);
There is a patch for the gdk_pixbuf symbols in bug #570952
g-s-t is unmaintained: http://blogs.gnome.org/carlosg/2008/02/01/two-new-children-in-cookieville/
Ah hmm. For more complicated stuff we should branch probably.
currently it's GTK_REQUIRED=2.11.3 GLIB_REQUIRED=2.15.2
Fixed two trivial ones: http://svn.gnome.org/viewvc/gnome-system-tools?view=revision&revision=4298 http://svn.gnome.org/viewvc/gnome-system-tools?view=revision&revision=4297
Created attachment 129431 [details] [review] Replace GTK_CHECK_* with G_TYPE_* equivalents Another fairly trivial change
I'd say just commit...
ok. Committed as r4301: http://svn.gnome.org/viewvc/gnome-system-tools?view=revision&revision=4301
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
Committed the patch as r4303: http://svn.gnome.org/viewvc/gnome-system-tools?view=revision&revision=4303
Deprecated symbols that are still left: http://library.gnome.org/devel/gtk/2.6/gtk-Signals.html#gtk-signal-emit ./src/users/search-bar/search-bar.c: gtk_signal_emit(GTK_OBJECT (sb), sb_signals [QUERY_CHANGED]); http://library.gnome.org/devel/gtk/2.6/gtk-Signals.html#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"); http://library.gnome.org/devel/gtk/2.6/GtkWindow.html#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);
Thomas, are you interested in handling those few remaining symbols?
Created attachment 133434 [details] [review] Replace deprecated gtk symbols in Users and Time Replaces the gtk_signal* stuff in Time and Users.
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.
Shweet. Branch and commit, I'd say?
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?
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. ;-)
> 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.
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.
Committed: http://git.gnome.org/cgit/gnome-system-tools/commit/?id=810e27b1caa03a62b91f0ba3b245f2b76a24a26e
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: http://git.gnome.org/cgit/evolution/commit/?id=0585b94eb27d02cf5cb0da87ee3bab85e2de6cbc
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.