GNOME Bugzilla – Bug 622467
Use accessor functions instead direct access (Use GSEAL GnomeGoal)
Last modified: 2020-03-05 10:53:29 UTC
See http://live.gnome.org/GnomeGoals/UseGseal
Created attachment 164370 [details] [review] Use accessor functions instead direct access Still remaining: GtkImage->data.name.pixbuf GTK_WIDGET_*SET_FLAGS (widget, GTK_HAS_FOCUS) -> This should be reworked as there won't be public api for this.
Review of attachment 164370 [details] [review]: ::: libslab/app-resizer.c @@ +89,3 @@ gint row = 0, col = 0; + + g_object_get (table, "n-columns", &maxcols, NULL); Hrm, don't we want a proper function in gtk+ for this? @@ +139,3 @@ if (resizer->cached_element_width == -1) { + GtkAllocation allocation; Please declare it at the end of the variables block: ie, declare variable in the order they're used. @@ +195,3 @@ AppResizer *resizer = APP_RESIZER (widget); + GtkAllocation child_allocation1; + GtkRequisition child_requisition, requisition; Same: declare at the end of the block. And child_allocation1 is a baaaad name. Should be child_allocation_current (or _old), for example. @@ +238,3 @@ } + + gtk_widget_get_requisition (GTK_WIDGET (resizer->cached_tables_list->data), &requisition); Can you move the get_requisition for the child here too? @@ +258,3 @@ + gtk_layout_set_size (GTK_LAYOUT (resizer), + child_allocation1.width, + child_allocation1.height); That's probably wrong: we've called size_allocate, so the allocation for the child needs to be fetched again. @@ +323,3 @@ if (app_data->selected_group) { + GtkAllocation widget_allocation, allocation; Move at the end of the block... And I would have called them allocation and selected_allocation (because we have widget and selected_widget). ::: libslab/app-shell.c @@ +468,3 @@ { AppShellData *app_data = (AppShellData *) user_data; + GtkAllocation allocation; declare at the end of the block... ::: libslab/search-context-picker.c @@ +94,3 @@ menu_position_func (GtkMenu * menu, int *x, int *y, gboolean * push_in, gpointer picker) { + GtkAllocation allocation; declare at the end of the block ::: libslab/shell-window.c @@ +92,3 @@ + gtk_widget_get_requisition (GTK_WIDGET (APP_RESIZER (app_data->category_layout)->child), + &req); Move this after the Fixme comment. @@ +135,3 @@ shell_window_paint_window (GtkWidget * widget, GdkEventExpose * event, gpointer data) { + GtkAllocation allocation; end of the block.. @@ +141,3 @@ right_pane = SHELL_WINDOW (widget)->_right_pane; + gtk_widget_get_allocation (left_pane, &allocation); add empty line after this ::: libslab/tile.c @@ +438,3 @@ { Tile *tile = TILE (data); + GtkAllocation allocation; end of the block...
Created attachment 164512 [details] [review] Use accessor functions instead direct access.v2 Here a new patch with your comments >::: libslab/app-resizer.c >@@ +238,3 @@ > } >+ >+ gtk_widget_get_requisition (GTK_WIDGET >(resizer->cached_tables_list->data), &requisition); > >Can you move the get_requisition for the child here too? No, because It's used in the block of code before.
Created attachment 164519 [details] [review] Use accessor functions instead direct access.v3 Use the new api to get the columns of the table
Review of attachment 164519 [details] [review]: Please commit with the slight change below. ::: libslab/app-resizer.c @@ +256,3 @@ if (GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate) (*GTK_WIDGET_CLASS (app_resizer_parent_class)->size_allocate) (widget, allocation); + gtk_widget_get_allocation (child, &child_allocation_old); It's a bit confusing to use the child_allocation_old name here, since it's not old anymore. So either find a way to not do use this name, or add a comment to clarify that you just want to avoid another variable.
Comment on attachment 164519 [details] [review] Use accessor functions instead direct access.v3 commit c86c8e28dd010da19f0ee5f3d12a284bfad6d548 I've used the same variable in all the function. Hope you agree with this. Still missing: image->data.name.pixbuf GTK_WIDGET_*SET_FLAGS(widget, GTK_HAS_FOCUS)
This project is not under active development anymore; see https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/263 Hence reflecting reality and mass-closing all its remaining open tasks.