diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2025-06-25 00:05:20 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2025-07-02 10:36:14 +0900 |
commit | cae9cdbcd9af044810bcceeb43a87accca47c71d (patch) | |
tree | 9ae31e6352e6432ba5d6510b0bf50b9c994ce0e1 | |
parent | 3beae8659513550b6b82a4ccdc4d25be9497f208 (diff) |
kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed()
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>
-rw-r--r-- | scripts/kconfig/gconf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 4acbcf912c6e..d7aa7bad965f 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -678,13 +678,14 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget, static 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); } } |