MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / initialize

Method initialize

src/common/supportfile/language.cpp:42–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void Language::initialize()
43{
44 if (!documents::languageGlobal.isEmpty()) {
45 return;
46 }
47
48 QJsonParseError err;
49 QFile file(globalPath());
50 if (file.open(QFile::ReadOnly)) {
51 auto data = file.readAll();
52 documents::languageGlobal = QJsonDocument::fromJson(data, &err);
53 file.close();
54 }
55
56 if (documents::languageGlobal.isEmpty()) {
57 CommonDialog::ok(QObject::tr("The format of the language configuration file is incorrect or damaged. "
58 "Check that the file is released correctly. "
59 "If it cannot be solved, reinstall the software to solve the problem"));
60 qCritical() << QString("Failed, %0 jsonDoc is Empty. ").arg(globalPath())
61 + "errorString: " + err.errorString();
62 abort();
63 }
64}
65
66bool Language::recovery()
67{

Callers

nothing calls this directly

Calls 7

abortFunction · 0.85
readAllMethod · 0.80
QStringClass · 0.50
isEmptyMethod · 0.45
openMethod · 0.45
closeMethod · 0.45
errorStringMethod · 0.45

Tested by

no test coverage detected