GNOME Bugzilla – Bug 164617
Don't use deprecated functions/objects
Last modified: 2005-01-23 00:04:38 UTC
Cupid compilation fails, because gnome.h no longer seems to include the necessary gettext headers: configuration.c: In function `gst_rec_configuration_add_encoder_selection': configuration.c:222: warning: implicit declaration of function `_' configuration.c:222: warning: passing arg 1 of `gtk_label_new' makes pointer from integer without a cast configuration.c: In function `gst_rec_configuration_get_muxer_page': configuration.c:477: warning: passing arg 1 of `gtk_label_new' makes pointer from integer without a cast [...etc...] After some digging, it seem gnome.h would eventually include gnome-i18n.h which would take care of the rest. gnome-i18n.h seems to be deprecated however, and "-DGNOME_DISABLE_DEPRECATED=1" prevents it from doing it's job.
There's more deprecation going on, (may want to change the bug title). I tried to make a patch, and it compiles, but it probably needs some work: - GtkFileChooserButton does not accept any save operation as it's action. (Already discussed this with Ronald on IRC, he turned out to be right. :p) - Not sure if the glib/gi18n.h header is the correct header to include here, but it works. - GtkAboutDialog provides a convenience function gtk_show_about_dialog that prevents multiple about dialogs from showing up. The constructor is asking for a 'parent' parameter though, which I don't know how to get there. As an extra bonus, some whitespace changes got caught up in the patch. Enjoy. :)
Created attachment 36258 [details] [review] Patch to fix (some of) the deprecation.
the parent for the dialog is the 'win' variable, 'win' is a GnomeApp/GtkWindow. I've removed the use of *_DISABLE_DEPRECATED for now, since that's the easy "fix". We also need to use GtkUIManager instead of the GnomeUIInfo stuff, btw, and maybe stop using GnomeApp/GnomeProgram alltogether (but that requires GOption inegrated everywhere, and that's not the case yet...). Changing topic and severity to reflect this, and adding depends: on the filechooserbutton save action bug.
Created attachment 36390 [details] [review] Revised patch This patch properly addresses all deprecation to the best of my knowledge, and also fixes some of the concerns mentioned above. GnomeUIInfo and GnomeApp don't seem to be deprecated, as the code still compiles with the defines enabled. I will try and take a look at it, though.
That looks pretty good. Some small nagging and then I'll accept it: * remove #include <gnome.h> everywhere where it's no longer required (in several places, I only used it for the _() macro) * update the gtk-version requirement in configure.ac
Created attachment 36396 [details] [review] Re-revised patch I hope this covers all of it. :)
Yup, that's good. GnomeApp/GnomeUIInfo are apparently still OK, so I've made a note on them in the TODO for later on. This can be closed. Thanks!