limited the number of calls to insertConnect() (costly)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3804 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-11-16 20:50:59 +00:00
parent 3727359982
commit b0756ff8c2

View File

@ -362,10 +362,17 @@ void NetworkDialog::updateDisplay()
/* get the list of Neighbours from the RsIface. */
void NetworkDialog::insertConnect()
{
static time_t last_time = 0 ;
if (!rsPeers)
{
return;
}
// Because this is called from a qt signal, there's no limitation between calls.
time_t now = time(NULL);
if(last_time + 5 > now) // never update more often then every 5 seconds.
return ;
last_time = now ;
std::list<std::string> neighs; //these are GPG ids
std::list<std::string>::iterator it;