1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 09:15:18 +00:00

setRequestStartIndex: actually set start index

It previously modified the limit for some template instances. That
obviously does not work.

Additionally, setRequestStartIndex and setRequestLimit have been
implemented for GetNextUpParams.

Fixes #19
This commit is contained in:
Chris Josten 2022-07-23 00:38:15 +02:00
parent 7ae204bf87
commit dd34e1a087
No known key found for this signature in database
GPG key ID: A69C050E9FD9FF6A
2 changed files with 14 additions and 2 deletions

View file

@ -251,6 +251,8 @@ extern template void setRequestLimit(Loader::GetResumeItemsParams &params, int l
extern template bool setRequestStartIndex(Loader::GetResumeItemsParams &params, int offset); extern template bool setRequestStartIndex(Loader::GetResumeItemsParams &params, int offset);
extern template void setRequestLimit(Loader::GetPublicUsersParams &params, int limit); extern template void setRequestLimit(Loader::GetPublicUsersParams &params, int limit);
extern template bool setRequestStartIndex(Loader::GetPublicUsersParams &params, int offset); extern template bool setRequestStartIndex(Loader::GetPublicUsersParams &params, int offset);
extern template void setRequestLimit(Loader::GetNextUpParams &params, int limit);
extern template bool setRequestStartIndex(Loader::GetNextUpParams &params, int offset);
extern template QList<DTO::UserDto> extractRecords(const QList<DTO::UserDto> &result); extern template QList<DTO::UserDto> extractRecords(const QList<DTO::UserDto> &result);
extern template int extractTotalRecordCount(const QList<DTO::UserDto> &result); extern template int extractTotalRecordCount(const QList<DTO::UserDto> &result);

View file

@ -150,7 +150,7 @@ void setRequestLimit(Loader::GetItemsByUserIdParams &params, int limit) {
template<> template<>
bool setRequestStartIndex(Loader::GetItemsByUserIdParams &params, int index) { bool setRequestStartIndex(Loader::GetItemsByUserIdParams &params, int index) {
params.setLimit(index); params.setStartIndex(index);
return true; return true;
} }
@ -161,7 +161,7 @@ void setRequestLimit(Loader::GetResumeItemsParams &params, int limit) {
template<> template<>
bool setRequestStartIndex(Loader::GetResumeItemsParams &params, int index) { bool setRequestStartIndex(Loader::GetResumeItemsParams &params, int index) {
params.setLimit(index); params.setStartIndex(index);
return true; return true;
} }
@ -174,6 +174,16 @@ bool setRequestStartIndex(Loader::GetPublicUsersParams &/*params*/, int /*offset
return false; return false;
} }
template<>
void setRequestLimit(Loader::GetNextUpParams &params, int limit) {
params.setLimit(limit);
}
template<>
bool setRequestStartIndex(Loader::GetNextUpParams &params, int offset) {
params.setStartIndex(offset);
return true;
}
template<> template<>
QList<DTO::UserDto> extractRecords(const QList<DTO::UserDto> &result) { QList<DTO::UserDto> extractRecords(const QList<DTO::UserDto> &result) {
return result; return result;