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 164617 - Don't use deprecated functions/objects
Don't use deprecated functions/objects
Status: RESOLVED FIXED
Product: Cupid
Classification: Deprecated
Component: general
HEAD
Other Linux
: Normal enhancement
: 0.0.2
Assigned To: Cupid Maintainers
Cupid Maintainers
Depends on: 164900
Blocks:
 
 
Reported: 2005-01-19 19:21 UTC by Stéphan Kochen
Modified: 2005-01-23 00:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix (some of) the deprecation. (8.32 KB, patch)
2005-01-19 21:50 UTC, Stéphan Kochen
none Details | Review
Revised patch (14.73 KB, patch)
2005-01-22 21:24 UTC, Stéphan Kochen
none Details | Review
Re-revised patch (16.44 KB, patch)
2005-01-22 23:39 UTC, Stéphan Kochen
none Details | Review

Description Stéphan Kochen 2005-01-19 19:21:07 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.
Comment 1 Stéphan Kochen 2005-01-19 21:48:42 UTC
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. :)
Comment 2 Stéphan Kochen 2005-01-19 21:50:06 UTC
Created attachment 36258 [details] [review]
Patch to fix (some of) the deprecation.
Comment 3 Ronald Bultje 2005-01-22 13:42:31 UTC
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.
Comment 4 Stéphan Kochen 2005-01-22 21:24:46 UTC
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.
Comment 5 Ronald Bultje 2005-01-22 22:57:43 UTC
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
Comment 6 Stéphan Kochen 2005-01-22 23:39:33 UTC
Created attachment 36396 [details] [review]
Re-revised patch

I hope this covers all of it. :)
Comment 7 Ronald Bultje 2005-01-23 00:04:38 UTC
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!