Changeset View
Changeset View
Standalone View
Standalone View
libdiscover/backends/KNSBackend/KNSBackend.cpp
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | 194 | if(resources.isEmpty() || m_page < 0) { | |||
---|---|---|---|---|---|
195 | Q_EMIT searchFinished(); | 195 | Q_EMIT searchFinished(); | ||
196 | Q_EMIT availableForQueries(); | 196 | Q_EMIT availableForQueries(); | ||
197 | setFetching(false); | 197 | setFetching(false); | ||
198 | return; | 198 | return; | ||
199 | } | 199 | } | ||
200 | // qDebug() << "received" << objectName() << this << m_page << m_resourcesByName.count(); | 200 | // qDebug() << "received" << objectName() << this << m_page << m_resourcesByName.count(); | ||
201 | if (!m_responsePending) { | 201 | if (!m_responsePending) { | ||
202 | ++m_page; | 202 | ++m_page; | ||
203 | m_engine->requestData(m_page, 100); | 203 | // We _have_ to set this first. If we do not, we may run into a situation where the | ||
204 | // data request will conclude immediately, causing m_responsePending to remain true | ||||
205 | // for perpetuity as the slots will be called before the function returns. | ||||
204 | m_responsePending = true; | 206 | m_responsePending = true; | ||
207 | m_engine->requestData(m_page, 100); | ||||
205 | } else { | 208 | } else { | ||
206 | Q_EMIT availableForQueries(); | 209 | Q_EMIT availableForQueries(); | ||
207 | } | 210 | } | ||
208 | } | 211 | } | ||
209 | 212 | | |||
210 | void KNSBackend::statusChanged(const KNSCore::EntryInternal& entry) | 213 | void KNSBackend::statusChanged(const KNSCore::EntryInternal& entry) | ||
211 | { | 214 | { | ||
212 | resourceForEntry(entry); | 215 | resourceForEntry(entry); | ||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |