# HG changeset patch # User Olaf Winermann <olaf.wintermann@gmail.com> # Date 1742750505 -3600 # Node ID f0c21da35aa4823b2129a58b829a996e31d39760 # Parent fefdfe7b2fc54b22973a3fb5e9cab19fa4b0036a improve ui_listview_update2 and add todo for further improvements (GTK) diff -r fefdfe7b2fc5 -r f0c21da35aa4 ui/gtk/list.c --- a/ui/gtk/list.c Sun Mar 23 18:09:24 2025 +0100 +++ b/ui/gtk/list.c Sun Mar 23 18:21:45 2025 +0100 @@ -585,8 +585,9 @@ void *value = list->get(list, i); if(value) { ObjWrapper *obj = obj_wrapper_new(value); - g_list_store_remove(view->liststore, i); - g_list_store_insert(view->liststore, i, obj); + // TODO: if index i is selected, the selection is lost + // is it possible to update the item without removing it? + g_list_store_splice(view->liststore, i, 1, (void **)&obj, 1); } } }