From: Masahiro Yamada Date: Tue, 24 Jun 2025 15:05:20 +0000 (+0900) Subject: kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed() X-Git-Tag: v6.16.2~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed262451deae37cb9164f35f365938463dd79168;p=thirdparty%2Fkernel%2Fstable.git kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed() [ 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 Signed-off-by: Sasha Levin --- diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index c0f46f1890607..abe4cfe66b146 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -942,13 +942,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); } }