1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 15:08:12 +00:00

LibGUI: Fetch data on a Node before traversing it, instead of after

Before this it wouldn't be possible to make decisions in
Node::traverse_if_needed based on the Node data because it would be
invalid.
This commit is contained in:
Adam Harald Jørgensen 2023-10-17 16:18:31 +02:00 committed by Andreas Kling
parent 60f9aa5cb8
commit 4d3c06ffe3

View file

@ -185,10 +185,9 @@ OwnPtr<FileSystemModel::Node> FileSystemModel::Node::create_child(DeprecatedStri
void FileSystemModel::Node::reify_if_needed()
{
if (mode == 0)
fetch_data(full_path(), m_parent == nullptr || m_parent->m_parent_of_root);
traverse_if_needed();
if (mode != 0)
return;
fetch_data(full_path(), m_parent == nullptr || m_parent->m_parent_of_root);
}
bool FileSystemModel::Node::is_symlink_to_directory() const