Skip to content

Commit

Permalink
Clear items via custom method instead broken builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Oct 24, 2023
1 parent 99277b9 commit 74181d1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion czkawka_gui/src/connect_things/connect_button_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,5 +797,18 @@ fn bad_extensions_search(
#[fun_time(message = "clean_tree_view", level = "debug")]
fn clean_tree_view(tree_view: &gtk4::TreeView) {
let list_store = get_list_store(tree_view);
list_store.clear();
let mut all_iters = Vec::new();
let first_iter = list_store.iter_first();
if let Some(first_iter) = first_iter {
loop {
all_iters.push(first_iter.clone());
if !list_store.iter_next(&first_iter) {
break;
}
}
}
all_iters.reverse();
for iter in all_iters {
list_store.remove(&iter);
}
}

0 comments on commit 74181d1

Please sign in to comment.