diff --git a/src/core/engine.h b/src/core/engine.h --- a/src/core/engine.h +++ b/src/core/engine.h @@ -136,6 +136,12 @@ QString adoptionCommand(const KNSCore::EntryInternal &entry) const; bool hasAdoptionCommand() const; + /** + * Set the page size for requests not made explicitly with requestData(int,int) + * @param pageSize the default number of entries to request from the provider + * @see requestData(int,int) + */ + void setPageSize(int pageSize); Q_SIGNALS: /** * Indicates a message to be added to the ui's log, or sent to a messagebox diff --git a/src/core/engine.cpp b/src/core/engine.cpp --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -322,6 +322,7 @@ { emit signalResetView(); m_currentPage = -1; + m_currentRequest.pageSize = m_pageSize; m_currentRequest.page = 0; m_numDataJobs = 0; @@ -388,6 +389,7 @@ { m_searchTimer->stop(); m_currentRequest = KNSCore::Provider::SearchRequest(KNSCore::Provider::Newest, KNSCore::Provider::ExactEntryId, id); + m_currentRequest.pageSize = m_pageSize; EntryInternal::List cache = m_cache->requestFromCache(m_currentRequest); if (!cache.isEmpty()) { @@ -612,6 +614,7 @@ foreach (QSharedPointer p, m_providers) { Provider::SearchRequest request(KNSCore::Provider::Newest, KNSCore::Provider::Installed); request.page = 0; + request.pageSize = m_pageSize; p->loadEntries(request); } } @@ -669,3 +672,8 @@ { return !m_adoptionCommand.isEmpty(); } + +void KNSCore::Engine::setPageSize(int pageSize) +{ + m_pageSize = pageSize; +}