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 749033 - modernize GObjects
modernize GObjects
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-06 18:34 UTC by Christian Hergert
Modified: 2015-05-08 18:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
builder: modernize GObjects.Use G_DECLARE_FINAL_TYPE() and G_DECLARE_DERIVABLE_TYPE() (173.27 KB, patch)
2015-05-08 13:17 UTC, Dimitris Zenios
committed Details | Review

Description Christian Hergert 2015-05-06 18:34:49 UTC
Lots of objects in Builder are still doing things the "old way".

Make sure everything that can be changed to G_DECLARE_FINAL_TYPE() or G_DECLARE_DERIVABLE_TYPE() is changed to do so. Once we bump to GtkSourceView-3.17 this should be easier.

We should be using g_object_class_install_properties() instead of installing each property one at a time. Beware of situations where we have overrides, since they will not have a param spec and could make this more difficult (not many).

As for parameter checks, generally speaking, my preference is:

 g_return_if_fail() or g_return_val_if_fail() in public API.
 g_assert() in functions that are "static"
Comment 1 Dimitris Zenios 2015-05-08 13:17:57 UTC
Created attachment 303075 [details] [review]
builder: modernize GObjects.Use  G_DECLARE_FINAL_TYPE() and G_DECLARE_DERIVABLE_TYPE()

This patch is only for builder source code.AKA src/ folder.
Comment 2 Christian Hergert 2015-05-08 18:55:15 UTC
Review of attachment 303075 [details] [review]:

Wow, thanks so much for doing this! I pushed to master with one small fix for a lingering ->priv.