GNOME Bugzilla – Bug 771845
trash-bar: port to use G_DECLARE* type declarations
Last modified: 2016-10-07 13:00:47 UTC
See bug 771777.
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.
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?
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.
I think you're right. I made another patch where I got rid of the extra struct.
Review of attachment 336774 [details] [review]: this looks good now, thanks Lavinia!
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.
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
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.
Review of attachment 337092 [details] [review]: Now looks good, thanks!!
Attachment 337092 [details] pushed as 78cc1b6 - trash-bar: port to G_DECLARE* type declaration