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

Method supportEncoding

src/plugins/codeeditor/utils/editorutils.cpp:47–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47QVector<QPair<QString, QStringList>> EditorUtils::supportEncoding()
48{
49 static QVector<QPair<QString, QStringList>> groupEncodeVec;
50 if (groupEncodeVec.isEmpty()) {
51 QFile file(":/encodes/encodes.ini");
52 QString data;
53 if (file.open(QIODevice::ReadOnly)) {
54 data = QString::fromUtf8(file.readAll());
55 file.close();
56 }
57
58 QTextStream readStream(&data, QIODevice::ReadOnly);
59 while (!readStream.atEnd()) {
60 QString group = readStream.readLine();
61 QString key = group.mid(1, group.length() - 2);
62 QString encodes = readStream.readLine();
63 QString value = encodes.mid(8, encodes.length() - 2);
64 groupEncodeVec.append(QPair<QString, QStringList>(key, value.split(",")));
65 }
66 }
67
68 return groupEncodeVec;
69}

Callers

nothing calls this directly

Calls 8

readAllMethod · 0.80
atEndMethod · 0.80
isEmptyMethod · 0.45
openMethod · 0.45
closeMethod · 0.45
readLineMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected