mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-25 19:02:07 -05: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
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue