summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-02-06 12:39:43 +0100
committerraveit65 <[email protected]>2022-07-21 19:33:51 +0200
commitf5e2356d75ac02ea367ee218ee1abd3ca21748c1 (patch)
treec71e23a4d8f8ac18c562f0888dea128de0c8d9e0
parentd5460179440e46da594b1da3a7f0c4e2f7e10b62 (diff)
downloadcaja-f5e2356d75ac02ea367ee218ee1abd3ca21748c1.tar.bz2
caja-f5e2356d75ac02ea367ee218ee1abd3ca21748c1.tar.xz
cppcheck warning: Local variable 'combo_box' shadows outer argument
-rw-r--r--src/caja-file-management-properties.c19
1 files 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);