This commit is contained in:
Zhenkai Zhu committed 2012-06-05 14:30:17 -07:00
1 parent 68f04d5ca4
commit 1c7d40ab02
2 files changed
+21 -1

No files matched your search

+6 -1
View File
@@ -186,7 +186,12 @@ ChatDialog::processData(QString name, const char *buf, size_t len)
appendMessage(msg);
// update the tree view
std::string prefix = name.toStdString().substr(0, name.toStdString().find_last_of('/'));
std::string stdStrName = name.toStdString();
std::string stdStrNameWithoutSeq = stdStrName.substr(0, stdStrName.find_last_of('/'));
std::string prefix = stdStrNameWithoutSeq.substr(0, stdStrNameWithoutSeq.find_last_of('/'));
#ifdef __DEBUG
std::cout <<"<<< updating scene for" << prefix << ": " << msg.from() << std::endl;
#endif
m_scene->msgReceived(prefix.c_str(), msg.from().c_str());
fitView();
}
+15
View File
@@ -66,6 +66,9 @@ DigestTreeScene::processUpdate(const std::vector<Sync::MissingDataInfo> &v, QStr
void
DigestTreeScene::msgReceived(QString prefix, QString nick)
{
#ifdef __DEBUG
std::cout << "Finding " << prefix.toStdString() << std::endl;
#endif
Roster_iterator it = m_roster.find(prefix);
if (it != m_roster.end())
{
@@ -89,6 +92,18 @@ DigestTreeScene::msgReceived(QString prefix, QString nick)
previouslyUpdatedUser = p;
}
#ifdef __DEBUG
else
{
std::cout << "Couldn't find prefix, let's check"<< std::endl;
Roster_iterator ii = m_roster.begin();
while (ii != m_roster.end())
{
std::cout <<"Prefix: " << ii.key().toStdString() << std::endl;
++ii;
}
}
#endif
}
void