GNOME Bugzilla – Bug 575131
Remove deprecated GTK+ symbols
Last modified: 2009-12-21 13:54:35 UTC
Potential patch contributors:
See http://library.gnome.org for API documentation.
Also note that a version bump in configure.ac/.in might be required.
Deprecated GTK+ symbols to be replaced:
GtkTooltipsData, gtk_action_block_activate_from, gtk_action_connect_proxy, gtk_action_unblock_activate_from, gtk_status_icon_set_tooltip, gtk_tooltips_data_get, gtk_tooltips_new, gtk_tooltips_set_tip
Created attachment 137074 [details] [review]
NetworkManager Applet remove deprecated GTK+
Attached is a patch discarding the last deprecated GTK+ symbols on the list in this bug from the NetworkManager Applet.
Two sections were adapted, both in src/polkit-helpers/polkit-gnome-action.c; I left the deprecated symbols there and used
to make sure the new symbols aren't used if they aren't there. Maybe it has no use, the GtkToolkit class was introduced in 2.11.3, but I wanted to be sure. I used the check because it was the way the deprecated symbols are handled in applet.c.
(In reply to comment #2)
> Two sections were adapted, both in src/polkit-helpers/polkit-gnome-action.c; I
> left the deprecated symbols there and used
> #if GTK_CHECK_VERSION
> to make sure the new symbols aren't used if they aren't there. Maybe it has no
> use, the GtkToolkit class was introduced in 2.11.3, but I wanted to be sure.
See in configure.ac, there's a check for gtk+-2.0 >= 2.14, so you don't need to check for older versions, which allow you to remove the older code.
The check is needed however for gtk_activatable_set_related_action, unless the maintainer is ok to bump the dependency to gtk+ >= 2.16.
Created attachment 137314 [details] [review]
nm-applet remove deprecated GTK+
The patch now only works with GTK+ 2.14 and above.
Please correct the indentation, the whole code uses spaces, and you're using tabs. That means that indentation is broken for people that don't have the right tabs = n spaces equivalence. Just click on your attached patch to see the result.
Created attachment 137372 [details] [review]
nm-applet remove deprecated GTK+
My apologizes for the much bug noise this all creates. I hope I got it right this time, I think I messed too much with Gedit's indentation settings before creating the previous patch.
This one was created on a fresh Git clone and with the space/indention settings left intact.
Oh, don't worry about that, these are small mistakes everyone does when starting to contribute ;-). The patch looks good to me, we just need a maintainer's authorization to commit it, now... Thank you sense for your work !
Looking at the patch, it touches just src/polkit-helpers/polkit-gnome-action.c. The thing is, that file should *only* be built on systems that are running a very old version of PolicyKit (ie, PK 0.6). Like Fedora Core 8, Ubuntu 8.04, etc. These systems are unlikely to be running a current version of GTK.
Thus, this code has to maintain compatibility with GTK 2.10, which doesn't have gtk_widget_set_tooltip_text() for example. So we should probably protect that conversion to gtk_widget_set_tooltip_text() with a GTK_CHECK_VERSION too.
Sound OK? Thanks for the patch, just a little bit more then we can commit :)
Created attachment 137890 [details] [review]
nm-applet dep. GTK+ symbols removed
This patch should do the trick! I have only tested it on Intrepid with GTK+ 2.16, maybe it requires some additional testing on older systems.
Could some networkmanager developer review the sense patch?
I believe this code is actually completely removed with 0.8, for which we are requiring a recent GTK anyway. So fixed there. Thanks!