diff options
Diffstat (limited to 'src/filetree.cpp')
| -rw-r--r-- | src/filetree.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/filetree.cpp b/src/filetree.cpp index 4316021a..af6ef70b 100644 --- a/src/filetree.cpp +++ b/src/filetree.cpp @@ -157,7 +157,28 @@ void FileTree::clear() void FileTree::ensureFullyLoaded() { + QAbstractProxyModel* proxy = nullptr; + + if (m_tree->model() != m_model) { + // looks like there's a proxy on the tree, disable it + proxy = dynamic_cast<QAbstractProxyModel*>(m_tree->model()); + + m_tree->setModel(m_model); + + if (proxy) { + if (proxy->sourceModel() != m_model) + DebugBreak(); + + proxy->setSourceModel(nullptr); + } + } + m_model->ensureFullyLoaded(); + + if (proxy) { + proxy->setSourceModel(m_model); + m_tree->setModel(proxy); + } } FileTreeItem* FileTree::singleSelection() |
