From f5e2356d75ac02ea367ee218ee1abd3ca21748c1 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sat, 6 Feb 2021 12:39:43 +0100 Subject: cppcheck warning: Local variable 'combo_box' shadows outer argument --- src/caja-file-management-properties.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c index cef4cbdf..199255be 100644 --- a/src/caja-file-management-properties.c +++ b/src/caja-file-management-properties.c @@ -357,25 +357,18 @@ icon_captions_changed_callback (GtkComboBox *combo_box, int i; builder = GTK_BUILDER (user_data); - captions = g_ptr_array_new (); for (i = 0; icon_captions_components[i] != NULL; i++) { - GtkWidget *combo_box; - int active; + GObject *object; GPtrArray *column_names; - char *name; - - combo_box = GTK_WIDGET (gtk_builder_get_object - (builder, icon_captions_components[i])); - active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box)); - - column_names = g_object_get_data (G_OBJECT (combo_box), - "column_names"); + int active; - name = g_ptr_array_index (column_names, active); - g_ptr_array_add (captions, name); + object = gtk_builder_get_object (builder, icon_captions_components[i]); + column_names = g_object_get_data (object, "column_names"); + active = gtk_combo_box_get_active (GTK_COMBO_BOX(object)); + g_ptr_array_add (captions, g_ptr_array_index (column_names, active)); } g_ptr_array_add (captions, NULL); -- cgit v1.2.1