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 786712 - Port NautilusPathBar to G_DECLARE_*_TYPE
Port NautilusPathBar to G_DECLARE_*_TYPE
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks: 771777
 
 
Reported: 2017-08-24 02:42 UTC by Vyas Giridhar
Modified: 2017-08-24 16:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pathbar: port declaration to G_DECLARE_*_TYPE (49.35 KB, patch)
2017-08-24 02:47 UTC, Vyas Giridhar
none Details | Review
pathbar: port declaration to G_DECLARE_*_TYPE (49.42 KB, patch)
2017-08-24 10:47 UTC, Vyas Giridhar
committed Details | Review
pathbar: rename method instance parameters (43.05 KB, patch)
2017-08-24 16:39 UTC, Ernestas Kulik
committed Details | Review

Description Vyas Giridhar 2017-08-24 02:42:36 UTC
port NautilusPathBar to G_DECLARE_*_TYPE.
Comment 1 Vyas Giridhar 2017-08-24 02:47:37 UTC
Created attachment 358296 [details] [review]
pathbar: port declaration to G_DECLARE_*_TYPE

This patch ports declaration of NautilusPathBar to
the G_DECLARE* format.

https://bugzilla.gnome.org/show_bug.cgi?id=771777
Comment 2 Ernestas Kulik 2017-08-24 08:15:09 UTC
Review of attachment 358296 [details] [review]:

Thanks! Your patch has some inconsistencies that should be taken care of, and you don’t have to mention bug 771777 in the message.

::: src/nautilus-pathbar.c
@@ +61,3 @@
 #define NAUTILUS_PATH_BAR_BUTTON_MAX_WIDTH 250
 
+struct _NautilusPathBarClass

This definitely belongs in the header, as deriving classes will need this completely defined.

@@ +165,3 @@
     path_bar = NAUTILUS_PATH_BAR (user_data);
+    priv = nautilus_path_bar_get_instance_private (path_bar);
+    if (!priv->context_menu_file)

If there was vertical whitespace here before, don’t remove it.

@@ +401,2 @@
     path_bar = NAUTILUS_PATH_BAR (object);
+    NautilusPathBarPrivate *priv;

This is misplaced.

@@ +624,2 @@
     nautilus_path_bar_stop_scrolling (NAUTILUS_PATH_BAR (widget));
+    priv = nautilus_path_bar_get_instance_private (NAUTILUS_PATH_BAR (widget));

Assignments should go before the code.

@@ +633,3 @@
 nautilus_path_bar_map (GtkWidget *widget)
 {
+    NautilusPathBarPrivate *priv;

Leave a space here.

@@ +994,2 @@
     path_bar = NAUTILUS_PATH_BAR (widget);
+    priv = nautilus_path_bar_get_instance_private (path_bar);

I would leave the empty line here. The operations on the window were grouped together, so keeping them separate makes sense.

@@ +1023,3 @@
 {
     NautilusPathBar *path_bar;
+    NautilusPathBarPrivate *priv;

Separate declarations from assignments.

@@ +1063,2 @@
     path_bar = NAUTILUS_PATH_BAR (container);
+    priv = nautilus_path_bar_get_instance_private (path_bar);

Leave the space as it was.

@@ +1299,3 @@
     GtkTextDirection direction;
     GtkAllocation allocation, button_allocation, slider_allocation;
+    NautilusPathBarPrivate *priv;

Generally, this will go first, as it’s assigned to first.

@@ +1304,3 @@
     up_button = NULL;
 
+    priv = nautilus_path_bar_get_instance_private (path_bar);

Put this before the other assignments.

@@ +1375,3 @@
 {
     GList *list;
+    NautilusPathBarPrivate *priv = nautilus_path_bar_get_instance_private (path_bar);

Keep it consistent, assign on a different line.

@@ +1400,3 @@
     gboolean retval = FALSE;
 
+    NautilusPathBarPrivate *priv = nautilus_path_bar_get_instance_private (path_bar);

Assign on a different line, you’re not assigning a constant.
Comment 3 Vyas Giridhar 2017-08-24 10:47:03 UTC
Created attachment 358317 [details] [review]
pathbar: port declaration to G_DECLARE_*_TYPE

This patch ports declaration of NautilusPathBar to
the G_DECLARE* format.
Comment 4 Ernestas Kulik 2017-08-24 15:32:46 UTC
Review of attachment 358317 [details] [review]:

Sure, thanks.

::: src/nautilus-pathbar.h
@@ +32,3 @@
 	void     (* path_clicked)   (NautilusPathBar  *path_bar,
 				     GFile            *location);
+    void     (* open_location)  (NautilusPathBar   *path_bar,

Spurious change here, but I’ll fix it up on my end, since everything else is all right.
Comment 5 Ernestas Kulik 2017-08-24 16:39:48 UTC
Created attachment 358362 [details] [review]
pathbar: rename method instance parameters
Comment 6 Ernestas Kulik 2017-08-24 16:41:13 UTC
Attachment 358317 [details] pushed as fbeb8f8 - pathbar: port declaration to G_DECLARE_*_TYPE
Attachment 358362 [details] pushed as 2e04a28 - pathbar: rename method instance parameters