mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-17 19:09:29 -04: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
1 changed files with 9 additions and 2 deletions
|
@ -362,10 +362,17 @@ void NetworkDialog::updateDisplay()
|
||||||
/* get the list of Neighbours from the RsIface. */
|
/* get the list of Neighbours from the RsIface. */
|
||||||
void NetworkDialog::insertConnect()
|
void NetworkDialog::insertConnect()
|
||||||
{
|
{
|
||||||
|
static time_t last_time = 0 ;
|
||||||
|
|
||||||
if (!rsPeers)
|
if (!rsPeers)
|
||||||
{
|
|
||||||
return;
|
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> neighs; //these are GPG ids
|
||||||
std::list<std::string>::iterator it;
|
std::list<std::string>::iterator it;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue