mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-14 11:19:08 +10:00
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>
This commit is contained in:
parent
3beae86595
commit
cae9cdbcd9
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user