| 294 | } |
| 295 | |
| 296 | void Model::updateStates() |
| 297 | { |
| 298 | if (!root_) |
| 299 | return; |
| 300 | |
| 301 | auto visitor = [this](Component &component, auto v) -> void { |
| 302 | if (!component.files.empty()) { |
| 303 | component.state = State::Actual; |
| 304 | for (auto &file : component.files) { |
| 305 | file.expandedPath = expanded(file.rawPath); |
| 306 | const auto fileState = currentState(file); |
| 307 | component.state = std::min(component.state, fileState); |
| 308 | } |
| 309 | auto index = toIndex(component, int(Column::State)); |
| 310 | emit dataChanged(index, index, {Qt::DisplayRole}); |
| 311 | |
| 312 | } else if (!component.children.empty()) { |
| 313 | for (auto &child : component.children) v(*child, v); |
| 314 | } |
| 315 | }; |
| 316 | |
| 317 | visitor(*root_, visitor); |
| 318 | } |
| 319 | |
| 320 | State Model::currentState(const File &file) const |
| 321 | { |
no outgoing calls
no test coverage detected