GNOME Bugzilla – Bug 778139
progress-info: port away from manual type decls
Last modified: 2017-04-18 08:19:22 UTC
See bug 771777.
Created attachment 344918 [details] [review] Patch to the bug This patch reduces the number of macros used to implement the progression-info type. Since the type is derivable, it creates a private structure to store instance variables.
Review of attachment 344918 [details] [review]: ::: src/nautilus-progress-info.h @@ +27,3 @@ +#define NAUTILUS_TYPE_PROGRESS_INFO (nautilus_progress_info_get_type ()) +G_DECLARE_DERIVABLE_TYPE(NautilusProgressInfo,nautilus_progress_info,NAUTILUS,PROGRESS_INFO,GObject) Why is this type derivable? Also, add a space after each comma. @@ +32,3 @@ +typedef struct _NautilusProgressInfoClass { + GObjectClass parent_class; +} NautilusProgessInfoClass; No need to typedef, plus, there is also a typo.
(In reply to Ernestas Kulik from comment #2) > Review of attachment 344918 [details] [review] [review]: > > ::: src/nautilus-progress-info.h > @@ +27,3 @@ > > +#define NAUTILUS_TYPE_PROGRESS_INFO (nautilus_progress_info_get_type ()) > +G_DECLARE_DERIVABLE_TYPE(NautilusProgressInfo,nautilus_progress_info, > NAUTILUS,PROGRESS_INFO,GObject) > > Why is this type derivable? Also, add a space after each comma. > > @@ +32,3 @@ > +typedef struct _NautilusProgressInfoClass { > + GObjectClass parent_class; > +} NautilusProgessInfoClass; > > No need to typedef, plus, there is also a typo. I thought that nautilus-progress-info-widget and nautilus-progress-info-manager inherit from progress-info, but I didn't see the type declaration of this two types.Sorry for the mistake.
Created attachment 344942 [details] [review] Port away from manual type decls I corrected the typo errors, but I didn't change the G_DECLARE* to a final type, because I think that maybe in a future another type can inherit from progress-info. If I have to change to a final type, only tell me. Regards, and thanks for the quick review.
Created attachment 348289 [details] [review] Patch Forget my last message, it makes more sense declare this type as final. Regards!
Review of attachment 348289 [details] [review]: Yeah! Thanks!
Attachment 348289 [details] pushed as 7821ab0 - progress-info: port away from manual decls