From d0c16e60d734fe2f72c387552559bf125554fb2d Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 7 Feb 2020 14:02:00 -0500 Subject: just disable recursive filtering when fully loading switching models clears persistent indexes and collapses everything --- src/filetree.cpp | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'src/filetree.cpp') diff --git a/src/filetree.cpp b/src/filetree.cpp index 937ffe4c..19f2555a 100644 --- a/src/filetree.cpp +++ b/src/filetree.cpp @@ -157,30 +157,14 @@ void FileTree::clear() m_model->clear(); } -void FileTree::ensureFullyLoaded() +bool FileTree::fullyLoaded() const { - QAbstractProxyModel* proxy = nullptr; - - if (m_tree->model() != m_model) { - // looks like there's a proxy on the tree, disable it - proxy = dynamic_cast(m_tree->model()); - - m_tree->setModel(m_model); - - if (proxy) { - if (proxy->sourceModel() != m_model) - DebugBreak(); - - proxy->setSourceModel(nullptr); - } - } + return m_model->fullyLoaded(); +} +void FileTree::ensureFullyLoaded() +{ m_model->ensureFullyLoaded(); - - if (proxy) { - proxy->setSourceModel(m_model); - m_tree->setModel(proxy); - } } FileTreeItem* FileTree::singleSelection() -- cgit v1.3.1