attempt at making remoteDirModel less CPU intentive. Remove potential deadlock source in SearchDialog.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4155 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-04-14 21:58:15 +00:00
parent 2dbd6f4380
commit a337941555
5 changed files with 82 additions and 12 deletions

View file

@ -27,6 +27,7 @@
#include "RetroShareLink.h"
#include "msgs/MessageComposer.h"
#include "gui/RSHumanReadableDelegate.h"
#include "gui/RsAutoUpdatePage.h"
#include "settings/rsharesettings.h"
#include "advsearch/advancedsearchdialog.h"
@ -672,6 +673,15 @@ void SearchDialog::updateFiles(qulonglong search_id,FileDetail file)
void SearchDialog::processResultQueue()
{
// This avoids a deadlock when gpg callback asks a passwd.
// Send again in 10 secs.
//
if(RsAutoUpdatePage::eventsLocked())
{
QTimer::singleShot(10000,this,SLOT(processResultQueue())) ;
return ;
}
int nb_treated_elements = 0 ;
while(!searchResultsQueue.empty() && nb_treated_elements++ < 500)