diff --git a/loader/src/ui/mods/ModListSource.cpp b/loader/src/ui/mods/ModListSource.cpp index edafd3f1..1443c963 100644 --- a/loader/src/ui/mods/ModListSource.cpp +++ b/loader/src/ui/mods/ModListSource.cpp @@ -1,7 +1,7 @@ #include "ModListSource.hpp" #include -static size_t PAGE_SIZE = 10; +static size_t PER_PAGE = 10; static size_t ceildiv(size_t a, size_t b) { // https://stackoverflow.com/questions/2745074/fast-ceiling-of-an-integer-division-in-c-c @@ -38,7 +38,7 @@ typename ModListSource::PagePromise ModListSource::loadPage(size_t page, bool up } std::optional ModListSource::getPageCount() const { - return m_cachedItemCount ? std::optional(ceildiv(m_cachedItemCount.value(), PAGE_SIZE)) : std::nullopt; + return m_cachedItemCount ? std::optional(ceildiv(m_cachedItemCount.value(), PER_PAGE)) : std::nullopt; } std::optional ModListSource::getItemCount() const { @@ -52,8 +52,8 @@ typename ModListSource::PagePromise InstalledModsList::reloadPage(size_t page) { auto content = Page(); auto all = Loader::get()->getAllMods(); for ( - size_t i = page * PAGE_SIZE; - i < all.size() && i < (page + 1) * PAGE_SIZE; + size_t i = page * PER_PAGE; + i < all.size() && i < (page + 1) * PER_PAGE; i += 1 ) { content.push_back(InstalledModItem::create(all.at(i))); @@ -72,7 +72,7 @@ typename ModListSource::PagePromise FeaturedModsList::reloadPage(size_t page) { return PagePromise([this, page](auto resolve, auto reject, auto progress, auto cancelled) { server::getMods(server::ModsQuery { .page = page, - .pageSize = PAGE_SIZE, + .pageSize = PER_PAGE, }) .then([this, resolve, reject](server::ServerModsList list) { m_cachedItemCount = list.totalModCount;