| 446 | } |
| 447 | |
| 448 | bool CFavoriteModel::UpdateTree(const QString &szFile) |
| 449 | { |
| 450 | auto items = m_pDatabase->GetFavorite(szFile); |
| 451 | foreach(auto it, items) { |
| 452 | if(it.id <= 0) continue; |
| 453 | tree* parent = GetTree(it.parentId); |
| 454 | if(!parent) continue; |
| 455 | QList<tree*> children = parent->FindChild(it); |
| 456 | if(children.isEmpty()) continue; |
| 457 | foreach(auto c, children) { |
| 458 | c->item = it; |
| 459 | QModelIndex changedIndex = CreateIndex(parent); |
| 460 | if (changedIndex.isValid()) { |
| 461 | emit dataChanged(changedIndex, changedIndex); |
| 462 | } |
| 463 | } |
| 464 | } |
| 465 | return true; |
| 466 | } |
| 467 | |
| 468 | bool CFavoriteModel::MoveTree(const CFavoriteDatabase::Item &item, int newParentId) |
| 469 | { |
nothing calls this directly
no test coverage detected