| 117 | } |
| 118 | |
| 119 | void 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 | |
| 153 | void UConfigMainWindow::reloadRuleSetList() |
| 154 | { |
nothing calls this directly
no test coverage detected