MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / onManifestReply

Method onManifestReply

app/src/Misc/HelpCenter.cpp:253–279  ·  view source on GitHub ↗

* @brief Handles the help.json manifest fetch response. */

Source from the content-addressed store, hash-verified

251 * @brief Handles the help.json manifest fetch response.
252 */
253void Misc::HelpCenter::onManifestReply()
254{
255 auto* reply = qobject_cast<QNetworkReply*>(sender());
256 if (!reply)
257 return;
258
259 reply->deleteLater();
260
261 if (reply->error() == QNetworkReply::NoError) {
262 const auto doc = QJsonDocument::fromJson(reply->readAll());
263 m_allPages = doc.array();
264 applyFilter();
265
266 if (!m_pendingPageId.isEmpty()) {
267 navigateToPage(m_pendingPageId);
268 m_pendingPageId.clear();
269 }
270
271 else if (!m_filteredPages.isEmpty())
272 setCurrentIndex(0);
273
274 preloadAllPages();
275 }
276
277 m_loading = false;
278 Q_EMIT loadingChanged();
279}
280
281/**
282 * @brief Handles the page content fetch response and caches it.

Callers

nothing calls this directly

Calls 5

senderFunction · 0.85
fromJsonFunction · 0.85
errorMethod · 0.80
isEmptyMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected