Commit 41b790f6 authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈
Browse files

Load the KNewStuff updates information on Discover startup

Without this, Discover only loads the installed items, but does not
also check whether there are updates available. This is cached by
the KNSCore::Engine, so we don't need the throttling in Discover itself,
but also if this is not done during the initialisation step, the updates
information will simply not be available.

parent d95fd3a2
......@@ -242,10 +242,22 @@ void KNSBackend::markInvalid(const QString &message)
void KNSBackend::fetchInstalled()
auto search = new OneTimeAction([this]() {
// First we ensure we've got data loaded on what we've got installed already
Q_EMIT startingSearch();
m_onePage = true;
m_responsePending = true;
// And then we check for updates - we could do only one, if all we cared about was updates,
// but to have both a useful initial list, /and/ information on updates, we want to get both.
// The reason we are not doing a checkUpdates() overload for this is that the caching for this
// information is done by KNSEngine, and we want to actually load it every time we initialize.
auto updateChecker = new OneTimeAction([this]() {
Q_EMIT startingSearch();
m_onePage = true;
m_responsePending = true;
}, this);
connect(this, &KNSBackend::availableForQueries, updateChecker, &OneTimeAction::trigger, Qt::QueuedConnection);
}, this);
if (m_responsePending) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment