added a spinbox to limit the number of search results (too many results may hang the gui)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2432 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-02-26 12:38:29 +00:00
parent d3c6e49ce4
commit 15a28b1d2e
2 changed files with 33 additions and 0 deletions

View file

@ -653,6 +653,16 @@ void SearchDialog::searchKeywords()
void SearchDialog::updateFiles(qulonglong search_id,FileDetail file)
{
static std::map<qulonglong,uint32_t> nb_results ;
if(nb_results.find(search_id) == nb_results.end())
nb_results[search_id] = 0 ;
if(nb_results[search_id] >= ui._max_results_SB->value())
return ;
else
++nb_results[search_id] ;
/* which extensions do we use? */
std::string txt = ui.lineEdit->text().toStdString();
#ifdef DEBUG