diff --git a/src/core/engine.h b/src/core/engine.h --- a/src/core/engine.h +++ b/src/core/engine.h @@ -178,12 +178,27 @@ void requestMoreData(); void requestData(int page, int pageSize); + /** + * Request for packages that are installed and need update + * + * These will be reported through the signal @sa signalUpdateableEntriesLoaded(). + */ void checkForUpdates(); + + /** + * Requests installed packages with an up to date state + * + * @note it will reset the engine state + * + * @sa signalEntriesLoaded() + */ void checkForInstalled(); /** * Convenience method to launch a search for one specific entry. * + * @note it will reset the engine state + * * @param id The ID of the entry you wish to fetch */ void fetchEntryById(const QString &id); diff --git a/src/core/engine.cpp b/src/core/engine.cpp --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -609,19 +609,20 @@ void Engine::checkForUpdates() { + const Provider::SearchRequest request(KNSCore::Provider::Newest, KNSCore::Provider::Updates); + foreach (QSharedPointer p, m_providers) { - Provider::SearchRequest request(KNSCore::Provider::Newest, KNSCore::Provider::Updates); p->loadEntries(request); } } void KNSCore::Engine::checkForInstalled() { + m_currentRequest = Provider::SearchRequest(KNSCore::Provider::Newest, KNSCore::Provider::Updates); + m_currentPage = -1; + foreach (QSharedPointer p, m_providers) { - Provider::SearchRequest request(KNSCore::Provider::Newest, KNSCore::Provider::Installed); - request.page = 0; - request.pageSize = m_pageSize; - p->loadEntries(request); + p->loadEntries(m_currentRequest); } }