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 622467 - Use accessor functions instead direct access (Use GSEAL GnomeGoal)
Use accessor functions instead direct access (Use GSEAL GnomeGoal)
Status: RESOLVED WONTFIX
Product: gnome-main-menu
Classification: Other
Component: libslab
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME main menu maintainers
GNOME main menu maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2010-06-23 02:24 UTC by Javier Jardón (IRC: jjardon)
Modified: 2020-03-05 10:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use accessor functions instead direct access (19.00 KB, patch)
2010-06-23 02:27 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Use accessor functions instead direct access.v2 (18.81 KB, patch)
2010-06-24 14:42 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Use accessor functions instead direct access.v3 (19.20 KB, patch)
2010-06-24 15:53 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Javier Jardón (IRC: jjardon) 2010-06-23 02:24:43 UTC
See http://live.gnome.org/GnomeGoals/UseGseal
Comment 1 Javier Jardón (IRC: jjardon) 2010-06-23 02:27:25 UTC
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.
Comment 2 Vincent Untz 2010-06-24 10:22:20 UTC
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...
Comment 3 Javier Jardón (IRC: jjardon) 2010-06-24 14:42:40 UTC
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.
Comment 4 Javier Jardón (IRC: jjardon) 2010-06-24 15:53:31 UTC
Created attachment 164519 [details] [review]
Use accessor functions instead direct access.v3

Use the new api to get the columns of the table
Comment 5 Vincent Untz 2010-06-28 13:16:49 UTC
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 6 Javier Jardón (IRC: jjardon) 2010-06-30 00:04:23 UTC
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)
Comment 7 André Klapper 2020-03-05 10:53:29 UTC
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.