History

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.

Masahiro Yamada committed 1 year ago

Commit cae9cdb1 parent 3beae861 file · +3 −2Browse files

Unified · Split

scripts/kconfig/gconf.c+3−2
@@ -678,13 +678,14 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget, · 677 unmodified lines
678678 static void on_treeview2_cursor_changed(GtkTreeView *treeview,
679679 gpointer user_data)
680680 {
681+ GtkTreeModel *model = gtk_tree_view_get_model(treeview);
681682 GtkTreeSelection *selection;
682683 GtkTreeIter iter;
683684 struct menu *menu;
684685
685686 selection = gtk_tree_view_get_selection(treeview);
686− if (gtk_tree_selection_get_selected(selection, &model2, &iter)) {
687− gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
687+ if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
688+ gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
688689 text_insert_help(menu);
689690 }
690691 }