comparison src/grapher.cpp @ 516:2981d2defa61

Introduce a graphical representation for merge from a closed to an open branch (half a connection item)
author Chris Cannam
date Thu, 20 Oct 2011 12:04:47 +0100
parents fc35aa6d433e
children fb196c016a9f
comparison
equal deleted inserted replaced
515:fc35aa6d433e 516:2981d2defa61
513 QString id = cs->id(); 513 QString id = cs->id();
514 if (!m_items.contains(id)) continue; 514 if (!m_items.contains(id)) continue;
515 ChangesetItem *item = m_items[id]; 515 ChangesetItem *item = m_items[id];
516 bool merge = (cs->parents().size() > 1); 516 bool merge = (cs->parents().size() > 1);
517 foreach (QString parentId, cs->parents()) { 517 foreach (QString parentId, cs->parents()) {
518 if (!m_items.contains(parentId)) continue; 518 if (!m_changesets.contains(parentId)) continue;
519 ConnectionItem *conn = new ConnectionItem(); 519 ConnectionItem *conn = new ConnectionItem();
520 if (merge) conn->setConnectionType(ConnectionItem::Merge); 520 if (merge) conn->setConnectionType(ConnectionItem::Merge);
521 conn->setChild(item); 521 conn->setChild(item);
522 conn->setParent(m_items[parentId]);
523 conn->setZValue(-1); 522 conn->setZValue(-1);
523 if (m_items.contains(parentId)) {
524 conn->setParent(m_items[parentId]);
525 } else {
526 conn->setMergedBranch(m_changesets[parentId]->branch());
527 }
524 m_scene->addItem(conn); 528 m_scene->addItem(conn);
525 } 529 }
526 } 530 }
527 531
528 // Add uncommitted item and connecting line as necessary 532 // Add uncommitted item and connecting line as necessary