MCPcopy Create free account
hub / github.com/Robotips/uConfig / updateRules

Method updateRules

src/uconfig_gui/uconfigmainwindow.cpp:119–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void UConfigMainWindow::updateRules()
120{
121 if (_ruleComboBox->currentText() == "package")
122 {
123 if (_componentWidget->component())
124 {
125 Component *component = _componentWidget->component();
126 _componentWidget->setComponent(Q_NULLPTR);
127 component->reorganizeToPackageStyle();
128 _componentWidget->setComponent(component);
129 }
130 return;
131 }
132 RulesSet ruleSet;
133 RulesParser parser;
134 parser.setData(_kssEditor->document()->toPlainText());
135 _kssEditor->setLineError(parser.errorLine());
136 if (!parser.parse(&ruleSet))
137 {
138 _kssEditor->setLineError(parser.errorLine());
139 return;
140 }
141
142 _kssEditor->setLineError(0);
143 PinRuler ruler(&ruleSet);
144 if (_componentWidget->component())
145 {
146 Component *component = _componentWidget->component();
147 _componentWidget->setComponent(Q_NULLPTR);
148 ruler.organize(component);
149 _componentWidget->setComponent(component);
150 }
151}
152
153void UConfigMainWindow::reloadRuleSetList()
154{

Callers

nothing calls this directly

Calls 8

setLineErrorMethod · 0.80
errorLineMethod · 0.80
parseMethod · 0.80
componentMethod · 0.45
setComponentMethod · 0.45
setDataMethod · 0.45
organizeMethod · 0.45

Tested by

no test coverage detected