]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kconfig: gconf: do not reconstruct tree store when a symbol is changed
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 24 Jun 2025 15:05:36 +0000 (00:05 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 2 Jul 2025 02:11:52 +0000 (11:11 +0900)
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>
scripts/kconfig/gconf.c

index 9df32f47bf6b5f6e5b3b5b120eeb6136343d7dd4..73736f79ddcb69cc63a8ea54efc489455d6847b7 100644 (file)
@@ -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)