summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/datatab.cpp4
-rw-r--r--src/filetreemodel.cpp10
-rw-r--r--src/filetreemodel.h2
3 files changed, 9 insertions, 7 deletions
diff --git a/src/datatab.cpp b/src/datatab.cpp
index af7eb18f..21c205e5 100644
--- a/src/datatab.cpp
+++ b/src/datatab.cpp
@@ -118,9 +118,9 @@ void DataTab::updateTree()
void DataTab::ensureFullyLoaded()
{
if (!m_filetree->fullyLoaded()) {
- m_filter.proxyModel()->setRecursiveFilteringEnabled(false);
+ m_filter.setFilteringEnabled(false);
m_filetree->ensureFullyLoaded();
- m_filter.proxyModel()->setRecursiveFilteringEnabled(true);
+ m_filter.setFilteringEnabled(true);
}
}
diff --git a/src/filetreemodel.cpp b/src/filetreemodel.cpp
index 8790f981..59025479 100644
--- a/src/filetreemodel.cpp
+++ b/src/filetreemodel.cpp
@@ -227,7 +227,7 @@ void FileTreeModel::clear()
void FileTreeModel::recursiveFetchMore(const QModelIndex& m)
{
if (canFetchMore(m)) {
- doFetchMore(m, false);
+ doFetchMore(m, false, false);
}
for (int i=0; i<rowCount(m); ++i) {
@@ -240,6 +240,7 @@ void FileTreeModel::ensureFullyLoaded()
if (!m_fullyLoaded) {
TimeThis tt("FileTreeModel:: fully loading for search");
recursiveFetchMore(QModelIndex());
+ sortItem(*m_root, false);
m_fullyLoaded = true;
}
}
@@ -350,10 +351,11 @@ bool FileTreeModel::canFetchMore(const QModelIndex& parent) const
void FileTreeModel::fetchMore(const QModelIndex& parent)
{
- doFetchMore(parent, true);
+ doFetchMore(parent, true, true);
}
-void FileTreeModel::doFetchMore(const QModelIndex& parent, bool forFetch)
+void FileTreeModel::doFetchMore(
+ const QModelIndex& parent, bool forFetch, bool doSort)
{
FileTreeItem* item = itemFromIndex(parent);
if (!item) {
@@ -373,7 +375,7 @@ void FileTreeModel::doFetchMore(const QModelIndex& parent, bool forFetch)
const auto parentPath = item->dataRelativeParentPath();
update(*item, *parentEntry, parentPath.toStdWString(), forFetch);
- if (!forFetch) {
+ if (!forFetch && doSort) {
sortItem(*item, false);
}
}
diff --git a/src/filetreemodel.h b/src/filetreemodel.h
index 4894e4be..73a18d91 100644
--- a/src/filetreemodel.h
+++ b/src/filetreemodel.h
@@ -119,7 +119,7 @@ private:
FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry,
const std::wstring& parentPath, bool forFetching);
- void doFetchMore(const QModelIndex& parent, bool forFetch);
+ void doFetchMore(const QModelIndex& parent, bool forFetch, bool doSort);
void queueRemoveItem(FileTreeItem* item);
void removeItems();