Count the friends (gpg id's) instead of the locations (ssl id's) in the statusbar.

Moved update of the friends from QTimer to signals.
Combined p3LinkMgr::getFriendCount and p3LinkMgr::getOnlineCount and moved to p3PeerMgr.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4986 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-25 01:48:56 +00:00
parent 4867c76bb1
commit 45ac04e2e7
11 changed files with 111 additions and 89 deletions

View file

@ -252,14 +252,12 @@ void p3LinkMgrIMPL::getFriendList(std::list<std::string> &ssl_peers)
{
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/
std::map<std::string, peerConnectState>::iterator it;
std::map<std::string, peerConnectState>::iterator it;
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
{
ssl_peers.push_back(it->first);
}
return;
}
bool p3LinkMgrIMPL::getPeerName(const std::string &ssl_id, std::string &name)
@ -268,34 +266,6 @@ bool p3LinkMgrIMPL::getPeerName(const std::string &ssl_id, std::string &name)
}
int p3LinkMgrIMPL::getFriendCount()
{
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/
return mFriendList.size();
}
int p3LinkMgrIMPL::getOnlineCount()
{
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/
int count = 0;
std::map<std::string, peerConnectState>::iterator it;
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
{
if (it->second.state & RS_PEER_S_CONNECTED)
{
count++;
}
}
return count;
}
bool p3LinkMgrIMPL::getFriendNetStatus(const std::string &id, peerConnectState &state)
{
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/