mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 04:14:27 -04:00
put the max result test at a more appropriate place in the code
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2454 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a516d53a5b
commit
9d6173a1ee
1 changed files with 11 additions and 10 deletions
|
@ -653,16 +653,6 @@ void SearchDialog::searchKeywords()
|
||||||
|
|
||||||
void SearchDialog::updateFiles(qulonglong search_id,FileDetail file)
|
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? */
|
/* which extensions do we use? */
|
||||||
std::string txt = ui.lineEdit->text().toStdString();
|
std::string txt = ui.lineEdit->text().toStdString();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -861,6 +851,17 @@ void SearchDialog::insertFile(const std::string& txt,qulonglong searchId, const
|
||||||
// 1.1 - If yes, just increment the result number.
|
// 1.1 - If yes, just increment the result number.
|
||||||
// 2.2 - Otherwize, add an entry.
|
// 2.2 - Otherwize, add an entry.
|
||||||
//
|
//
|
||||||
|
//
|
||||||
|
static std::map<qulonglong,uint32_t> nb_results ;
|
||||||
|
|
||||||
|
if(nb_results.find(searchId) == nb_results.end())
|
||||||
|
nb_results[searchId] = 0 ;
|
||||||
|
|
||||||
|
if(nb_results[searchId] >= ui._max_results_SB->value())
|
||||||
|
return ;
|
||||||
|
else
|
||||||
|
++nb_results[searchId] ;
|
||||||
|
|
||||||
|
|
||||||
// 1 - look in result window whether the file already exists.
|
// 1 - look in result window whether the file already exists.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue