]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed()
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 24 Jun 2025 15:05:20 +0000 (00:05 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:29 +0000 (16:28 +0200)
[ Upstream commit cae9cdbcd9af044810bcceeb43a87accca47c71d ]

The on_treeview2_cursor_changed() handler is connected to both the left
and right tree views, but it hardcodes model2 (the GtkTreeModel of the
right tree view). This is incorrect. Get the associated model from the
view.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/kconfig/gconf.c

index 9e52c7360e55b488902f84c656daaeaf8ee0accd..a9f78e167e2ece877f99658dd28a62e58cf2daee 100644 (file)
@@ -974,13 +974,14 @@ on_treeview2_key_press_event(GtkWidget * widget,
 void
 on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data)
 {
+       GtkTreeModel *model = gtk_tree_view_get_model(treeview);
        GtkTreeSelection *selection;
        GtkTreeIter iter;
        struct menu *menu;
 
        selection = gtk_tree_view_get_selection(treeview);
-       if (gtk_tree_selection_get_selected(selection, &model2, &iter)) {
-               gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+       if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+               gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
                text_insert_help(menu);
        }
 }