MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / fetchError

Method fetchError

Telegram/SourceFiles/storage/localstorage.cpp:1391–1409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1389}
1390
1391void CustomLangPack::fetchError(QNetworkReply::NetworkError e) {
1392 LOG(("Network error: %1").arg(e));
1393
1394 if (e == QNetworkReply::NetworkError::ContentNotFoundError) {
1395 QString langPackBaseId = Lang::GetInstance().baseId();
1396 QString langPackId = Lang::GetInstance().id();
1397
1398 if (!langPackId.isEmpty() && !langPackBaseId.isEmpty() && !needFallback) {
1399 LOG(("64Gram Language pack not found! Fallback to main language: %1...").arg(langPackBaseId));
1400 needFallback = true;
1401 _chkReply->disconnect();
1402 fetchCustomLangPack("", langPackBaseId);
1403 } else {
1404 LOG(("64Gram Language pack not found! Fallback to default language: English..."));
1405 loadDefaultLangFile();
1406 _chkReply = nullptr;
1407 }
1408 }
1409}
1410
1411void CustomLangPack::loadDefaultLangFile() {
1412 QFile file(":/localization/en.json");

Callers

nothing calls this directly

Calls 3

baseIdMethod · 0.80
idMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected