Changeset View
Changeset View
Standalone View
Standalone View
libdiscover/backends/KNSBackend/KNSBackend.cpp
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Line(s) | 197 | { | |||
---|---|---|---|---|---|
204 | } | 204 | } | ||
205 | return r; | 205 | return r; | ||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | void KNSBackend::receivedEntries(const KNSCore::EntryInternal::List& entries) | 208 | void KNSBackend::receivedEntries(const KNSCore::EntryInternal::List& entries) | ||
209 | { | 209 | { | ||
210 | m_responsePending = false; | 210 | m_responsePending = false; | ||
211 | 211 | | |||
212 | const auto resources = kTransform<QVector<AbstractResource*>>(entries, [this](const KNSCore::EntryInternal& entry){ return resourceForEntry(entry); }); | 212 | const auto filtered = kFilter<KNSCore::EntryInternal::List>(entries, [this](const KNSCore::EntryInternal& entry){ return entry.isValid(); }); | ||
213 | const auto resources = kTransform<QVector<AbstractResource*>>(filtered, [this](const KNSCore::EntryInternal& entry){ return resourceForEntry(entry); }); | ||||
apol: first arg should be `filtered`. | |||||
leinir: Oh dear! Yes, it should. | |||||
213 | if (!resources.isEmpty()) { | 214 | if (!resources.isEmpty()) { | ||
214 | Q_EMIT receivedResources(resources); | 215 | Q_EMIT receivedResources(resources); | ||
215 | } else { | 216 | } else { | ||
216 | Q_EMIT searchFinished(); | 217 | Q_EMIT searchFinished(); | ||
217 | Q_EMIT availableForQueries(); | 218 | Q_EMIT availableForQueries(); | ||
218 | setFetching(false); | 219 | setFetching(false); | ||
219 | return; | 220 | return; | ||
220 | } | 221 | } | ||
▲ Show 20 Lines • Show All 291 Lines • Show Last 20 Lines |
first arg should be filtered.