GNOME Bugzilla – Bug 786712
Port NautilusPathBar to G_DECLARE_*_TYPE
Last modified: 2017-08-24 16:41:28 UTC
port NautilusPathBar to G_DECLARE_*_TYPE.
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
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.
Created attachment 358317 [details] [review] pathbar: port declaration to G_DECLARE_*_TYPE This patch ports declaration of NautilusPathBar to the G_DECLARE* format.
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.
Created attachment 358362 [details] [review] pathbar: rename method instance parameters
Attachment 358317 [details] pushed as fbeb8f8 - pathbar: port declaration to G_DECLARE_*_TYPE Attachment 358362 [details] pushed as 2e04a28 - pathbar: rename method instance parameters