mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix searching past the end
This commit is contained in:
parent
51cbe0f6d8
commit
b314f41f6b
1 changed files with 6 additions and 1 deletions
|
@ -61,8 +61,13 @@ TimelineFilter::event(QEvent *ev)
|
||||||
incrementalSearchIndex += 30;
|
incrementalSearchIndex += 30;
|
||||||
|
|
||||||
if (auto s = source(); s) {
|
if (auto s = source(); s) {
|
||||||
|
auto count = s->rowCount();
|
||||||
|
if (incrementalSearchIndex >= count) {
|
||||||
|
incrementalSearchIndex = std::numeric_limits<int>::max();
|
||||||
|
}
|
||||||
|
nhlog::ui()->debug("Filter progress {}/{}", incrementalSearchIndex, count);
|
||||||
s->dataChanged(s->index(orgIndex),
|
s->dataChanged(s->index(orgIndex),
|
||||||
s->index(std::min(incrementalSearchIndex, s->rowCount() - 1)),
|
s->index(std::min(incrementalSearchIndex, count - 1)),
|
||||||
{FilterRole});
|
{FilterRole});
|
||||||
continueFiltering();
|
continueFiltering();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue