summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/domain/folderlistmodel.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/framework/src/domain/folderlistmodel.cpp b/framework/src/domain/folderlistmodel.cpp
index 1fe2abe6..c25e8bd6 100644
--- a/framework/src/domain/folderlistmodel.cpp
+++ b/framework/src/domain/folderlistmodel.cpp
@@ -33,12 +33,14 @@ FolderListModel::FolderListModel(QObject *parent) : KRecursiveFilterProxyModel()
33 33
34 //Automatically fetch all folders, otherwise the recursive filtering does not work. 34 //Automatically fetch all folders, otherwise the recursive filtering does not work.
35 QObject::connect(this, &QSortFilterProxyModel::sourceModelChanged, [this] () { 35 QObject::connect(this, &QSortFilterProxyModel::sourceModelChanged, [this] () {
36 QObject::connect(sourceModel(), &QAbstractItemModel::rowsInserted, sourceModel(), [this] (QModelIndex parent, int first, int last) { 36 if (sourceModel()) {
37 for (int row = first; row <= last; row++) { 37 QObject::connect(sourceModel(), &QAbstractItemModel::rowsInserted, sourceModel(), [this] (QModelIndex parent, int first, int last) {
38 auto idx = sourceModel()->index(row, 0, parent); 38 for (int row = first; row <= last; row++) {
39 sourceModel()->fetchMore(idx); 39 auto idx = sourceModel()->index(row, 0, parent);
40 } 40 sourceModel()->fetchMore(idx);
41 }); 41 }
42 });
43 }
42 }); 44 });
43} 45}
44 46