[EGD-3451] RequestRecordsCount refactor in whole project.

This commit is contained in:
Przemyslaw Brudny
2020-08-04 17:41:34 +02:00
committed by PrzeBrudny
parent 02afbac399
commit 19e1ca696c
38 changed files with 61 additions and 131 deletions

View File

@@ -15,14 +15,10 @@
NotesModel::NotesModel(app::Application *app) : DatabaseModel(app)
{}
void NotesModel::requestRecordsCount()
unsigned int NotesModel::requestRecordsCount()
{
recordsCount = DBServiceAPI::NotesGetCount(application);
// request first and second page if possible
if (recordsCount > 0) {
DBServiceAPI::NotesGetLimitOffset(application, 0, 3);
}
return recordsCount;
}
void NotesModel::requestRecords(const uint32_t offset, const uint32_t limit)
@@ -45,7 +41,6 @@ bool NotesModel::updateRecords(std::unique_ptr<std::vector<NotesRecord>> records
#endif
DatabaseModel::updateRecords(std::move(records), offset, limit, count);
modelIndex = 0;
list->onProviderDataUpdate();
return true;