listview: Remove an unused member variable
authorBenjamin Otte <otte@redhat.com>
Fri, 3 Mar 2023 01:35:56 +0000 (02:35 +0100)
committerBenjamin Otte <otte.benjamin@googlemail.com>
Sun, 5 Mar 2023 15:23:20 +0000 (15:23 +0000)
It's only used in the allocate function, so make it a local varaible
there.

gtk/gtklistview.c
gtk/gtklistviewprivate.h

index 9904bf1072b6faf13c05fcb6a9956a1737e016dc..e9d5d11cf877f8e901bd4864882931d16b34f996 100644 (file)
@@ -481,7 +481,7 @@ gtk_list_view_size_allocate (GtkWidget *widget,
   GtkListView *self = GTK_LIST_VIEW (widget);
   GtkListTile *tile;
   GArray *heights;
-  int min, nat, row_height, y;
+  int min, nat, row_height, y, list_width;
   GtkOrientation orientation, opposite_orientation;
   GtkScrollablePolicy scroll_policy, opposite_scroll_policy;
 
@@ -501,11 +501,11 @@ gtk_list_view_size_allocate (GtkWidget *widget,
   gtk_list_view_measure_across (widget, opposite_orientation,
                                 -1,
                                 &min, &nat);
-  self->list_width = orientation == GTK_ORIENTATION_VERTICAL ? width : height;
+  list_width = orientation == GTK_ORIENTATION_VERTICAL ? width : height;
   if (opposite_scroll_policy == GTK_SCROLL_MINIMUM)
-    self->list_width = MAX (min, self->list_width);
+    list_width = MAX (min, list_width);
   else
-    self->list_width = MAX (nat, self->list_width);
+    list_width = MAX (nat, list_width);
 
   /* step 2: determine height of known list items and gc the list */
   heights = g_array_new (FALSE, FALSE, sizeof (int));
@@ -518,13 +518,13 @@ gtk_list_view_size_allocate (GtkWidget *widget,
         continue;
 
       gtk_widget_measure (tile->widget, orientation,
-                          self->list_width,
+                          list_width,
                           &min, &nat, NULL, NULL);
       if (scroll_policy == GTK_SCROLL_MINIMUM)
         row_height = min;
       else
         row_height = nat;
-      gtk_list_tile_set_area_size (self->item_manager, tile, self->list_width, row_height);
+      gtk_list_tile_set_area_size (self->item_manager, tile, list_width, row_height);
       g_array_append_val (heights, row_height);
     }
 
@@ -539,7 +539,7 @@ gtk_list_view_size_allocate (GtkWidget *widget,
     {
       gtk_list_tile_set_area_position (self->item_manager, tile, 0, y);
       if (tile->widget == NULL)
-        gtk_list_tile_set_area_size (self->item_manager, tile, self->list_width, row_height * tile->n_items);
+        gtk_list_tile_set_area_size (self->item_manager, tile, list_width, row_height * tile->n_items);
 
       y += tile->area.height;
     }
index 007e75661ad0bd156f8eb316c33f2e06e9bc9555..5e323d9e146711ccc9597ef97f8a067df09606a9 100644 (file)
@@ -31,8 +31,6 @@ struct _GtkListView
 
   GtkListItemManager *item_manager;
   gboolean show_separators;
-
-  int list_width;
 };
 
 struct _GtkListViewClass