comparison src/grapher.cpp @ 506:470829a21f98

Identify closed branches and display them in a lighter shade
author Chris Cannam
date Mon, 17 Oct 2011 22:08:05 +0100
parents 69fb864a3972
children c43880dfdb78
comparison
equal deleted inserted replaced
505:1c05e7576ea5 506:470829a21f98
433 conn->setZValue(-1); 433 conn->setZValue(-1);
434 m_scene->addItem(conn); 434 m_scene->addItem(conn);
435 } 435 }
436 } 436 }
437 437
438 // Ensure the closed branches are all marked as closed
439
440 foreach (QString closedId, m_closedIds) {
441
442 if (!m_items.contains(closedId)) continue;
443
444 Changeset *cs = m_changesets[closedId];
445 ChangesetItem *item = m_items[closedId];
446
447 while (cs && item) {
448
449 if (cs->children().size() > 1) {
450 break;
451 }
452
453 item->setClosed(true);
454
455 int pcount = cs->parents().size();
456 if (pcount >= 1) {
457 QString pid = cs->parents()[0];
458 if (!m_items.contains(pid)) break;
459 cs = m_changesets[pid];
460 item = m_items[pid];
461 } else {
462 item = 0;
463 }
464 }
465 }
466
438 // Add uncommitted item and connecting line as necessary 467 // Add uncommitted item and connecting line as necessary
439 468
440 if (!m_uncommittedParents.empty()) { 469 if (!m_uncommittedParents.empty()) {
441 470
442 m_uncommitted = new UncommittedItem(); 471 m_uncommitted = new UncommittedItem();