From bb8bd48dc0618e7a2551b7e82ed33e8bc2f45ad4 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Sun, 5 Mar 2023 14:42:23 +0000 Subject: [PATCH] CharacterMap: Pause updates while generating search results Co-authored-by: Tim Flynn --- Userland/Applications/CharacterMap/CharacterSearchWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp b/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp index 4c87103979..cc8b250d51 100644 --- a/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterSearchWidget.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Sam Atkins + * Copyright (c) 2022-2023, Sam Atkins * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause @@ -79,6 +79,9 @@ CharacterSearchWidget::CharacterSearchWidget() void CharacterSearchWidget::search() { + ScopeGuard guard { [&] { m_results_table->set_updates_enabled(true); } }; + m_results_table->set_updates_enabled(false); + // TODO: Sort the results nicely. They're sorted by code-point for now, which is easy, but not the most useful. // Sorting intelligently in a style similar to Assistant would be nicer. auto& model = static_cast(*m_results_table->model());