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 771845 - trash-bar: port to use G_DECLARE* type declarations
trash-bar: port to use G_DECLARE* type declarations
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.21.x
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks: 771777
 
 
Reported: 2016-09-22 15:50 UTC by Ernestas Kulik
Modified: 2016-10-07 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
trash-bar: port to G_DECLARE* type declaration (6.60 KB, patch)
2016-10-02 13:36 UTC, Sirbu Lavinia Stefania
none Details | Review
trash-bar: port to G_DECLARE* type declaration (4.60 KB, patch)
2016-10-02 21:33 UTC, Sirbu Lavinia Stefania
none Details | Review
trash-bar: port to G_DECLARE* type declaration (6.36 KB, patch)
2016-10-06 18:33 UTC, Sirbu Lavinia Stefania
committed Details | Review

Description Ernestas Kulik 2016-09-22 15:50:48 UTC
See bug 771777.
Comment 1 Sirbu Lavinia Stefania 2016-10-02 13:36:56 UTC
Created attachment 336758 [details] [review]
trash-bar: port to G_DECLARE* type declaration

Currently we are using the old GObject class declarations, which have two
problems.

One problem is that we cannot use smart pointers like g_autoptr. The other
problem is the boilerplate code generated that makes the code less readable,
so harder to understand.

To fix this use G_DECLARE* type.
Comment 2 Ernestas Kulik 2016-10-02 13:48:28 UTC
Review of attachment 336758 [details] [review]:

::: src/nautilus-trash-bar.c
@@ +51,1 @@
+G_DEFINE_TYPE_WITH_PRIVATE (NautilusTrashBar, nautilus_trash_bar, GTK_TYPE_INFO_BAR)

Would it not be better to hide the type struct definition and use that to store private data instead of a separate struct?
Comment 3 Sirbu Lavinia Stefania 2016-10-02 21:33:22 UTC
Created attachment 336774 [details] [review]
trash-bar: port to G_DECLARE* type declaration

Currently we are using the old GObject class declarations, which have two
problems.

One problem is that we cannot use smart pointers like g_autoptr. The other
problem is the boilerplate code generated that makes the code less readable,
so harder to understand.

To fix this use G_DECLARE* type.
Comment 4 Sirbu Lavinia Stefania 2016-10-02 21:50:48 UTC
I think you're right. I made another patch where I got rid of the extra struct.
Comment 5 Carlos Soriano 2016-10-04 20:27:24 UTC
Review of attachment 336774 [details] [review]:

this looks good now, thanks Lavinia!
Comment 6 Carlos Soriano 2016-10-04 20:29:09 UTC
Comment on attachment 336758 [details] [review]
trash-bar: port to G_DECLARE* type declaration

I obsoleted this patch. Next time, you can obsolete a patch that you submitted before by clicking on "details" and then marking the checkbox "obsolete". This allows to know what patch is the correct or latest one, and also it allows to work better with git bz apply for further review.
Comment 7 Carlos Soriano 2016-10-04 20:36:46 UTC
Review of attachment 336774 [details] [review]:

Sorry I just realized this patch is not correct. This is a patch above another patch. The nautilus-trash-bar.h was not like this before, so this patch doesn't apply to master. I got fooled by the .c file :)

Read https://wiki.gnome.org/Newcomers/CodeContributionWorkflow#Follow_Up_on_the_Feedback for know how to modify your previous patch based on feedback of the review
Comment 8 Sirbu Lavinia Stefania 2016-10-06 18:33:26 UTC
Created attachment 337092 [details] [review]
trash-bar: port to G_DECLARE* type declaration

Currently we are using the old GObject class declarations, which have two
problems.

One problem is that we cannot use smart pointers like g_autoptr. The other
problem is the boilerplate code generated that makes the code less readable,
so harder to understand.

To fix this use G_DECLARE* type.
Comment 9 Carlos Soriano 2016-10-06 18:36:37 UTC
Review of attachment 337092 [details] [review]:

Now looks good, thanks!!
Comment 10 Ernestas Kulik 2016-10-07 13:00:35 UTC
Attachment 337092 [details] pushed as 78cc1b6 - trash-bar: port to G_DECLARE* type declaration