summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-11-22 19:18:10 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-11-22 19:18:10 +0100
commitf440b411953c2aad752848390d67de7e75a2f1bc (patch)
treeceefcec45f5b33dab805adef1fa7b7b4ad044a6a /src
parentFix cmark warning (diff)
downloadnheko-f440b411953c2aad752848390d67de7e75a2f1bc.tar.xz
Fix stack overflow when filtering timeline
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineFilter.cpp3
-rw-r--r--src/timeline/TimelineModel.cpp5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/timeline/TimelineFilter.cpp b/src/timeline/TimelineFilter.cpp
index cd17a7f6..91cae637 100644
--- a/src/timeline/TimelineFilter.cpp
+++ b/src/timeline/TimelineFilter.cpp
@@ -69,7 +69,8 @@ TimelineFilter::setSource(TimelineModel *s)
         this->setSourceModel(s);
 
         connect(s, &TimelineModel::currentIndexChanged, this, &TimelineFilter::currentIndexChanged);
-        connect(s, &TimelineModel::fetchedMore, this, &TimelineFilter::fetchAgain);
+        connect(
+          s, &TimelineModel::fetchedMore, this, &TimelineFilter::fetchAgain, Qt::QueuedConnection);
 
         emit sourceChanged();
         invalidateFilter();
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 6b764081..dedfa197 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -880,6 +880,9 @@ TimelineModel::setPaginationInProgress(const bool paginationInProgress)
 
     m_paginationInProgress = paginationInProgress;
     emit paginationInProgressChanged(m_paginationInProgress);
+
+    if (m_paginationInProgress)
+        events.fetchMore();
 }
 
 void
@@ -891,8 +894,6 @@ TimelineModel::fetchMore(const QModelIndex &)
     }
 
     setPaginationInProgress(true);
-
-    events.fetchMore();
 }
 
 void