https://bugs.kde.org/show_bug.cgi?id=484035
--- Comment #3 from scram...@gmail.com ---
In: /usr/src/debug/knewstuff/knewstuff-6.0.0/src/core/resultsstream.cpp:70

(Untested Suggestion)...
void ResultsStream::fetch()
{
    if (d->request.filter != Provider::Installed) {
        // when asking for installed entries, never use the cache
        Entry::List cacheEntries =
d->engine->cache()->requestFromCache(d->request);
        if (!cacheEntries.isEmpty()) {
            Q_EMIT entriesFound(cacheEntries);
            return;
        }
    }

    for (const QSharedPointer<KNSCore::Provider> &p :
std::as_const(d->providers)) {
        // Check if the shared pointer is not null and the provider is
initialized
        if (p && p->isInitialized()) {
            p->loadEntries(d->request);
        } else if (p) {
            // If p is not null but the provider is not initialized, set up a
connection to call loadEntries when the provider is initialized.
            connect(p.get(), &KNSCore::Provider::providerInitialized, this,
[this, p] {
                disconnect(p.get(), &KNSCore::Provider::providerInitialized,
this, nullptr);
                if (p->isInitialized()) {
                    p->loadEntries(d->request);
                }
            });
        } else {
            qWarning() << "Encountered a null provider in
ResultsStream::fetch.";
        }
    }
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to