add sync functions
diff --git a/digesttreescene.cpp b/digesttreescene.cpp
index 5133e4c..0dd7a10 100644
--- a/digesttreescene.cpp
+++ b/digesttreescene.cpp
@@ -36,11 +36,11 @@
: QGraphicsScene(parent)
{
previouslyUpdatedUser = DisplayUserNullPtr;
- testDraw(this);
+// testDraw(this);
}
void
-DigestTreeScene::processUpdate(std::vector<Sync::MissingDataInfo> &v, QString digest)
+DigestTreeScene::processUpdate(const std::vector<Sync::MissingDataInfo> &v, QString digest)
{
int n = v.size();
bool rePlot = false;
@@ -81,21 +81,6 @@
}
void
-DigestTreeScene::reDrawNode(DisplayUserPtr p, QColor rimColor)
-{
- QGraphicsRectItem *rimItem = p->getRimRectItem();
- rimItem->setBrush(QBrush(rimColor));
- QGraphicsRectItem *innerItem = p->getInnerRectItem();
- innerItem->setBrush(QBrush(Qt::lightGray));
- QGraphicsTextItem *seqTextItem = p->getSeqTextItem();
- std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
- seqTextItem->setPlainText(s.c_str());
- QRectF textBR = seqTextItem->boundingRect();
- QRectF innerBR = innerItem->boundingRect();
- seqTextItem->setPos(innerBR.x() + (innerBR.width() - textBR.width())/2, innerBR.y() + (innerBR.height() - textBR.height())/2);
-}
-
-void
DigestTreeScene::msgReceived(QString prefix, QString nick)
{
Roster_iterator it = m_roster.find(prefix);
@@ -124,6 +109,14 @@
}
void
+DigestTreeScene::clearAll()
+{
+ clear();
+ m_graph.clear();
+ m_roster.clear();
+}
+
+void
DigestTreeScene::plot(QString digest)
{
clear();
@@ -250,3 +243,18 @@
}
}
+void
+DigestTreeScene::reDrawNode(DisplayUserPtr p, QColor rimColor)
+{
+ QGraphicsRectItem *rimItem = p->getRimRectItem();
+ rimItem->setBrush(QBrush(rimColor));
+ QGraphicsRectItem *innerItem = p->getInnerRectItem();
+ innerItem->setBrush(QBrush(Qt::lightGray));
+ QGraphicsTextItem *seqTextItem = p->getSeqTextItem();
+ std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
+ seqTextItem->setPlainText(s.c_str());
+ QRectF textBR = seqTextItem->boundingRect();
+ QRectF innerBR = innerItem->boundingRect();
+ seqTextItem->setPos(innerBR.x() + (innerBR.width() - textBR.width())/2, innerBR.y() + (innerBR.height() - textBR.height())/2);
+}
+