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 778139 - progress-info: port away from manual type decls
progress-info: port away from manual type decls
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
master
Other All
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks: 771777
 
 
Reported: 2017-02-03 14:01 UTC by Ernestas Kulik
Modified: 2017-04-18 08:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to the bug (25.02 KB, patch)
2017-02-04 08:08 UTC, Kevin Lopez
none Details | Review
Port away from manual type decls (25.00 KB, patch)
2017-02-04 17:49 UTC, Kevin Lopez
none Details | Review
Patch (2.27 KB, patch)
2017-03-20 00:45 UTC, Kevin Lopez
committed Details | Review

Description Ernestas Kulik 2017-02-03 14:01:40 UTC
See bug 771777.
Comment 1 Kevin Lopez 2017-02-04 08:08:40 UTC
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.
Comment 2 Ernestas Kulik 2017-02-04 08:49:55 UTC
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.
Comment 3 Kevin Lopez 2017-02-04 17:15:38 UTC
(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.
Comment 4 Kevin Lopez 2017-02-04 17:49:36 UTC
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.
Comment 5 Kevin Lopez 2017-03-20 00:45:38 UTC
Created attachment 348289 [details] [review]
Patch

Forget my last message, it makes more sense declare this type as final.

Regards!
Comment 6 Carlos Soriano 2017-03-22 16:22:31 UTC
Review of attachment 348289 [details] [review]:

Yeah! Thanks!
Comment 7 Ernestas Kulik 2017-04-18 08:19:22 UTC
Attachment 348289 [details] pushed as 7821ab0 - progress-info: port away from manual decls