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

Method apply

src/plugins/smartut/gui/widget/generalsettingwidget.cpp:122–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122bool GeneralSettingWidget::apply()
123{
124 auto setting = SmartUTManager::instance()->utSetting();
125 const auto &format = nameFormatEdit->text();
126 if (format.isEmpty() || !format.contains("${filename}")) {
127 nameFormatEdit->setAlert(true);
128 nameFormatEdit->showAlertMessage(tr("Please input a valid format, e.g.ut_${filename}.cpp"));
129 nameFormatEdit->setFocus();
130 nameFormatEdit->lineEdit()->selectAll();
131 return false;
132 }
133 setting->setValue(kGeneralGroup, kNameFormat, format);
134
135 QStringList templateList;
136 for (int i = 1; i < templateCB->count(); ++i) {
137 templateList << templateCB->itemText(i);
138 }
139
140 setting->setValue(kGeneralGroup, kTemplates, templateList);
141 setting->setValue(kActiveGroup, kActiveTemplate, templateCB->currentIndex() == 0 ? "" : templateCB->currentText());
142 setting->setValue(kActiveGroup, kActiveTestFramework, testFrameworkCB->currentText());
143 return true;
144}

Callers

nothing calls this directly

Calls 9

utSettingMethod · 0.80
setFocusMethod · 0.80
selectAllMethod · 0.80
textMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45
setValueMethod · 0.45
countMethod · 0.45
currentIndexMethod · 0.45

Tested by

no test coverage detected