mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05:00
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:
parent
3727359982
commit
b0756ff8c2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user