소스 검색

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.
Conrad Pankoff 6 년 전
부모
커밋
9b6e99f17e
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      Libraries/LibGUI/GFileSystemModel.cpp

+ 1 - 0
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)