MCPcopy Create free account
hub / github.com/OneMoreGres/ScreenTranslator / updateStates

Method updateStates

src/service/updates.cpp:296–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296void 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
320State Model::currentState(const File &file) const
321{

Callers 2

applyActionMethod · 0.80
downloadedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected