Skip to content

Commit

Permalink
Fix fetchMore in activityListModel which fixes testing
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
  • Loading branch information
claucambra authored and mgallien committed Jan 31, 2022
1 parent 4a9b802 commit ce87b1f
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/gui/tray/activitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,16 +624,8 @@ void ActivityListModel::combineActivityLists()
}

beginResetModel();
_finalList.clear();
_finalList = resultList;
endResetModel();

qDebug() << "Row count after reset: " << rowCount();

if (resultList.count() > 0) {
beginInsertRows(QModelIndex(), 0, resultList.count() - 1);
_finalList = resultList;
endInsertRows();
}
}

bool ActivityListModel::canFetchActivities() const
Expand All @@ -643,11 +635,8 @@ bool ActivityListModel::canFetchActivities() const

void ActivityListModel::fetchMore(const QModelIndex &)
{
if (canFetchActivities()) {
if (canFetchActivities() && !_currentlyFetching) {
startFetchJob();
} else {
_doneFetching = true;
combineActivityLists();
}
}

Expand Down Expand Up @@ -677,5 +666,6 @@ void ActivityListModel::slotRemoveAccount()
_totalActivitiesFetched = 0;
_showMoreActivitiesAvailableEntry = false;
}

}

0 comments on commit ce87b1f

Please sign in to comment.