summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-06-25 00:05:36 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2025-07-02 11:11:52 +0900
commit035c2f56f57432caa78378e3ab498a5fb9bd276b (patch)
tree8bbaadf04bddf8e9d8e419f10987305806631219
parent64285dc5c41fc7a031695c2c286a2bfef9eaf2c6 (diff)
kconfig: gconf: do not reconstruct tree store when a symbol is changed
There is no need to reconstruct the entire tree store when a symbol's value changes. Simply call gtk_tree_store_set() to update the row data. Introduce update_trees() to factor out the common update logic. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-rw-r--r--scripts/kconfig/gconf.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 9df32f47bf6b..73736f79ddcb 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -296,6 +296,13 @@ static void update_tree(GtkTreeStore *store)
update_row_visibility();
}
+static void update_trees(void)
+{
+ if (view_mode == SPLIT_VIEW)
+ update_tree(tree1);
+ update_tree(tree2);
+}
+
static void set_view_mode(enum view_mode mode)
{
view_mode = mode;
@@ -380,7 +387,7 @@ static void on_load1_activate(GtkMenuItem *menuitem, gpointer user_data)
text_insert_msg("Error",
"Unable to load configuration!");
else
- display_tree_part();
+ update_trees();
g_free(filename);
}
@@ -699,7 +706,7 @@ static void renderer_edited(GtkCellRendererText * cell,
sym_set_string_value(sym, new_def);
- update_tree(tree2);
+ update_trees();
free:
gtk_tree_path_free(path);
@@ -729,14 +736,7 @@ static void change_sym_value(struct menu *menu, gint col)
if (!sym_tristate_within_range(sym, newval))
newval = yes;
sym_set_tristate_value(sym, newval);
- if (view_mode == FULL_VIEW)
- update_tree(tree2);
- else if (view_mode == SPLIT_VIEW) {
- update_tree(tree2);
- display_list();
- }
- else if (view_mode == SINGLE_VIEW)
- display_tree_part(); //fixme: keep exp/coll
+ update_trees();
break;
case S_INT:
case S_HEX:
@@ -752,14 +752,7 @@ static void toggle_sym_value(struct menu *menu)
return;
sym_toggle_tristate_value(menu->sym);
- if (view_mode == FULL_VIEW)
- update_tree(tree2);
- else if (view_mode == SPLIT_VIEW) {
- update_tree(tree2);
- display_list();
- }
- else if (view_mode == SINGLE_VIEW)
- display_tree_part(); //fixme: keep exp/coll
+ update_trees();
}
static gint column2index(GtkTreeViewColumn * column)