From 9b6e99f17eedcad2b2bf0bc3fbb9300feeb63c5c Mon Sep 17 00:00:00 2001 From: Conrad Pankoff Date: Thu, 1 Aug 2019 00:18:47 +1000 Subject: [PATCH] LibGUI: Reify intermediate nodes during index traversal In the event where you want to find the index of a deeply-nested path with a GFileSystemModel that hasn't yet traversed most of that path, it is possible for a false negative failure to occur. This failure is caused by the GFileSystemModel incorrectly bailing out of the search when it hits the first unseen path segment that is not at the very end of the path. This patch fixes this problem by reifying the intermediate nodes during that search and traversal process. --- Libraries/LibGUI/GFileSystemModel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibGUI/GFileSystemModel.cpp b/Libraries/LibGUI/GFileSystemModel.cpp index 0f1112cc1a4..14bab66b011 100644 --- a/Libraries/LibGUI/GFileSystemModel.cpp +++ b/Libraries/LibGUI/GFileSystemModel.cpp @@ -107,6 +107,7 @@ GModelIndex GFileSystemModel::index(const StringView& path) const bool found = false; for (auto& child : node->children) { if (child->name == part) { + child->reify_if_needed(*this); node = child; found = true; if (i == canonical_path.parts().size() - 1)