fix sync logic bug about seqno
demo works with small flaws
diff --git a/demo/digesttreescene.cpp b/demo/digesttreescene.cpp
index 35df071..4bf699e 100644
--- a/demo/digesttreescene.cpp
+++ b/demo/digesttreescene.cpp
@@ -25,13 +25,18 @@
for (int i = 0; i < n; i++)
{
Roster_iterator it = m_roster.find(v[i].prefix.c_str());
- if (it == m_roster.end()) {
+ if (it == m_roster.end())
+ {
rePlot = true;
DisplayUserPtr p(new DisplayUser());
p->setPrefix(v[i].prefix.c_str());
p->setSeq(v[i].high);
m_roster.insert(p->getPrefix(), p);
}
+ else
+ {
+ it.value()->setSeq(v[i].high);
+ }
}
if (rePlot)
@@ -77,7 +82,7 @@
reDrawNode(p, Qt::red);
- if (previouslyUpdatedUser != DisplayUserNullPtr)
+ if (previouslyUpdatedUser != DisplayUserNullPtr && previouslyUpdatedUser != p)
{
reDrawNode(previouslyUpdatedUser, Qt::darkBlue);
}