MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / searchRequestFailed

Method searchRequestFailed

launcher/ui/pages/modplatform/ModModel.cpp:256–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void ListModel::searchRequestFailed(QString reason)
257{
258 auto failed_action = jobPtr->getFailedActions().at(0);
259 if (!failed_action->m_reply) {
260 // Network error
261 QMessageBox::critical(nullptr, tr("Error"), tr("A network error occurred. Could not load mods."));
262 } else if (failed_action->m_reply && failed_action->m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 409) {
263 // 409 Gone, notify user to update
264 QMessageBox::critical(nullptr, tr("Error"),
265 //: %1 refers to the launcher itself
266 QString("%1 %2")
267 .arg(m_parent->displayName())
268 .arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_NAME)));
269 }
270 jobPtr.reset();
271
272 if (searchState == ResetRequested) {
273 beginResetModel();
274 modpacks.clear();
275 endResetModel();
276
277 nextSearchOffset = 0;
278 performPaginatedSearch();
279 } else {
280 searchState = Finished;
281 }
282}
283
284void ListModel::infoRequestFinished(QJsonDocument& doc, ModPlatform::IndexedPack& pack, const QModelIndex& index)
285{

Callers

nothing calls this directly

Calls 6

QStringClass · 0.85
getFailedActionsMethod · 0.80
atMethod · 0.45
displayNameMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected