summaryrefslogtreecommitdiff
path: root/src/filetreemodel.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-07-10 13:58:58 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-07-10 13:58:58 -0400
commit16c7cc5605d4e71f509acfcb4881df833de11853 (patch)
tree56d625ba6522bae9806bcf7c32c3f1a8b0fab654 /src/filetreemodel.cpp
parentc8e1d62af0694f69f08659b57a0425f0151bf690 (diff)
fixed ensureFullyLoaded() taking forever because it was queuing all the sorts unnecessarily
Diffstat (limited to 'src/filetreemodel.cpp')
-rw-r--r--src/filetreemodel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/filetreemodel.cpp b/src/filetreemodel.cpp
index cf5bc665..11901c43 100644
--- a/src/filetreemodel.cpp
+++ b/src/filetreemodel.cpp
@@ -226,7 +226,7 @@ void FileTreeModel::clear()
void FileTreeModel::recursiveFetchMore(const QModelIndex& m)
{
if (canFetchMore(m)) {
- fetchMore(m);
+ doFetchMore(m, false);
}
for (int i=0; i<rowCount(m); ++i) {
@@ -338,6 +338,11 @@ bool FileTreeModel::canFetchMore(const QModelIndex& parent) const
void FileTreeModel::fetchMore(const QModelIndex& parent)
{
+ doFetchMore(parent, true);
+}
+
+void FileTreeModel::doFetchMore(const QModelIndex& parent, bool forFetch)
+{
FileTreeItem* item = itemFromIndex(parent);
if (!item) {
return;
@@ -354,7 +359,7 @@ void FileTreeModel::fetchMore(const QModelIndex& parent)
}
const auto parentPath = item->dataRelativeParentPath();
- update(*item, *parentEntry, parentPath.toStdWString(), true);
+ update(*item, *parentEntry, parentPath.toStdWString(), forFetch);
}
QVariant FileTreeModel::data(const QModelIndex& index, int role) const