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

Method initMenuData

src/plugins/codeeditor/statusbar/encodecombobox.cpp:57–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void EncodeComboBox::initMenuData()
58{
59 static QMap<QString, QString> translationMap {
60 { "Unicode", tr("Unicode") },
61 { "WesternEuropean", tr("WesternEuropean") },
62 { "CentralEuropean", tr("CentralEuropean") },
63 { "Baltic", tr("Baltic") },
64 { "Cyrillic", tr("Cyrillic") },
65 { "Arabic", tr("Arabic") },
66 { "Greek", tr("Greek") },
67 { "Hebrew", tr("Hebrew") },
68 { "Turkish", tr("Turkish") },
69 { "Thai", tr("Thai") },
70 { "Celtic", tr("Celtic") },
71 { "SouthEasternEuropean", tr("SouthEasternEuropean") },
72 { "ChineseSimplified", tr("ChineseSimplified") },
73 { "ChineseTraditional", tr("ChineseTraditional") },
74 { "Japanese", tr("Japanese") },
75 { "Korean", tr("Korean") },
76 { "Vietnamese", tr("Vietnamese") }
77 };
78
79 auto groupEncodeVec = EditorUtils::supportEncoding();
80 if (!groupEncodeVec.isEmpty()) {
81 int cnt = groupEncodeVec.size();
82 for (int i = 0; i < cnt; i++) {
83 const auto &groupName = groupEncodeVec[i].first;
84 QMenu *groupMenu = new QMenu(translationMap.value(groupName, groupName));
85 foreach (const QString &var, groupEncodeVec[i].second) {
86 groupMenu->addAction(var);
87 }
88 menu->addMenu(groupMenu);
89 }
90 }
91}
92
93void EncodeComboBox::setEncodeName(const QString &encoding)
94{

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
addMenuMethod · 0.45

Tested by

no test coverage detected