mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-05 18:44:27 +03:00
FileManager: Ignore model updates during widget construction
We can't use current_view() before we've actually constructed the subviews, so just ignore statusbar update requests before they get a chance to call current_view(). This is not the most beautiful thing, and maybe we can think of a nicer approach.
This commit is contained in:
parent
5fdc8c14a6
commit
c31cc8c060
Notes:
sideshowbarker
2024-07-19 01:48:14 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c31cc8c0603
@ -388,6 +388,10 @@ void DirectoryView::open_next_directory()
|
||||
|
||||
void DirectoryView::update_statusbar()
|
||||
{
|
||||
// If we're triggered during widget construction, just ignore it.
|
||||
if (m_view_mode == ViewMode::Invalid)
|
||||
return;
|
||||
|
||||
size_t total_size = model().node({}).total_size;
|
||||
if (current_view().selection().is_empty()) {
|
||||
set_status_message(String::formatted("{} item(s) ({})",
|
||||
|
Loading…
Reference in New Issue
Block a user