MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / UpdateTree

Method UpdateTree

App/Client/Favorite/FavoriteModel.cpp:448–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448bool 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
468bool CFavoriteModel::MoveTree(const CFavoriteDatabase::Item &item, int newParentId)
469{

Callers

nothing calls this directly

Calls 1

GetFavoriteMethod · 0.45

Tested by

no test coverage detected