瀏覽代碼

TreeView: Clear metadata after model update

When the filesystem model is updated, it is rebuilt. This means dangling
indexes inside the TreeView metadata table will have old information and random
directories will toggle open. Clearing the table alleviates this issue.
Tommy Nguyen 5 年之前
父節點
當前提交
d8b7cd940f
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Libraries/LibGUI/GTreeView.cpp

+ 1 - 0
Libraries/LibGUI/GTreeView.cpp

@@ -250,6 +250,7 @@ void GTreeView::scroll_into_view(const GModelIndex& a_index, Orientation orienta
 
 
 void GTreeView::did_update_model()
 void GTreeView::did_update_model()
 {
 {
+    m_view_metadata.clear();
     GAbstractView::did_update_model();
     GAbstractView::did_update_model();
     update_content_size();
     update_content_size();
     update();
     update();