Use constant for legacy search result page size

meow-7.2.2
Ansariel 2016-08-19 14:51:12 +02:00
parent 1d2c0d11ef
commit 909002097f
1 changed files with 25 additions and 24 deletions

View File

@ -72,6 +72,7 @@
#include <boost/algorithm/string.hpp>
static const S32 MIN_SEARCH_STRING_SIZE = 2;
static const S32 RESULT_PAGE_SIZE = 100;
std::string filterShortWords(std::string query_string);
void fillSearchComboBox(LLSearchComboBox* search_combo);
@ -784,7 +785,7 @@ void FSPanelSearchPeople::onBtnFind()
void FSPanelSearchPeople::onBtnNext()
{
mStartSearch += 100;
mStartSearch += RESULT_PAGE_SIZE;
getChildView("people_back")->setEnabled(TRUE);
find();
@ -792,7 +793,7 @@ void FSPanelSearchPeople::onBtnNext()
void FSPanelSearchPeople::onBtnBack()
{
mStartSearch -= 100;
mStartSearch -= RESULT_PAGE_SIZE;
getChildView("people_back")->setEnabled(mStartSearch > 0);
find();
@ -807,11 +808,11 @@ void FSPanelSearchPeople::resetSearch()
S32 FSPanelSearchPeople::showNextButton(S32 rows)
{
bool show_next_button = (mResultsReceived > 100);
bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE);
getChildView("people_next")->setEnabled(show_next_button);
if (show_next_button)
{
rows -= (mResultsReceived - 100);
rows -= (mResultsReceived - RESULT_PAGE_SIZE);
}
return rows;
}
@ -1070,7 +1071,7 @@ void FSPanelSearchGroups::onBtnFind()
void FSPanelSearchGroups::onBtnNext()
{
mStartSearch += 100;
mStartSearch += RESULT_PAGE_SIZE;
getChildView("groups_back")->setEnabled(TRUE);
find();
@ -1078,7 +1079,7 @@ void FSPanelSearchGroups::onBtnNext()
void FSPanelSearchGroups::onBtnBack()
{
mStartSearch -= 100;
mStartSearch -= RESULT_PAGE_SIZE;
getChildView("groups_back")->setEnabled(mStartSearch > 0);
find();
@ -1093,11 +1094,11 @@ void FSPanelSearchGroups::resetSearch()
S32 FSPanelSearchGroups::showNextButton(S32 rows)
{
bool show_next_button = (mResultsReceived > 100);
bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE);
getChildView("groups_next")->setEnabled(show_next_button);
if (show_next_button)
{
rows -= (mResultsReceived - 100);
rows -= (mResultsReceived - RESULT_PAGE_SIZE);
}
return rows;
}
@ -1385,7 +1386,7 @@ void FSPanelSearchPlaces::onBtnFind()
void FSPanelSearchPlaces::onBtnNext()
{
mStartSearch += 100;
mStartSearch += RESULT_PAGE_SIZE;
getChildView("places_back")->setEnabled(TRUE);
find();
@ -1393,7 +1394,7 @@ void FSPanelSearchPlaces::onBtnNext()
void FSPanelSearchPlaces::onBtnBack()
{
mStartSearch -= 100;
mStartSearch -= RESULT_PAGE_SIZE;
getChildView("places_back")->setEnabled(mStartSearch > 0);
find();
@ -1408,11 +1409,11 @@ void FSPanelSearchPlaces::resetSearch()
S32 FSPanelSearchPlaces::showNextButton(S32 rows)
{
bool show_next_button = (mResultsReceived > 100);
bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE);
getChildView("places_next")->setEnabled(show_next_button);
if (show_next_button)
{
rows -= (mResultsReceived - 100);
rows -= (mResultsReceived - RESULT_PAGE_SIZE);
}
return rows;
}
@ -1727,7 +1728,7 @@ void FSPanelSearchLand::onBtnFind()
void FSPanelSearchLand::onBtnNext()
{
mStartSearch += 100;
mStartSearch += RESULT_PAGE_SIZE;
getChildView("land_back")->setEnabled(TRUE);
find();
@ -1735,7 +1736,7 @@ void FSPanelSearchLand::onBtnNext()
void FSPanelSearchLand::onBtnBack()
{
mStartSearch -= 100;
mStartSearch -= RESULT_PAGE_SIZE;
getChildView("land_back")->setEnabled(mStartSearch > 0);
find();
@ -1750,11 +1751,11 @@ void FSPanelSearchLand::resetSearch()
S32 FSPanelSearchLand::showNextButton(S32 rows)
{
bool show_next_button = (mResultsReceived > 100);
bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE);
getChildView("land_next")->setEnabled(show_next_button);
if (show_next_button)
{
rows -= (mResultsReceived - 100);
rows -= (mResultsReceived - RESULT_PAGE_SIZE);
}
return rows;
}
@ -2056,7 +2057,7 @@ void FSPanelSearchClassifieds::onBtnFind()
void FSPanelSearchClassifieds::onBtnNext()
{
mStartSearch += 100;
mStartSearch += RESULT_PAGE_SIZE;
getChildView("classifieds_back")->setEnabled(TRUE);
find();
@ -2064,7 +2065,7 @@ void FSPanelSearchClassifieds::onBtnNext()
void FSPanelSearchClassifieds::onBtnBack()
{
mStartSearch -= 100;
mStartSearch -= RESULT_PAGE_SIZE;
getChildView("classifieds_back")->setEnabled(mStartSearch > 0);
find();
@ -2079,11 +2080,11 @@ void FSPanelSearchClassifieds::resetSearch()
S32 FSPanelSearchClassifieds::showNextButton(S32 rows)
{
bool show_next_button = (mResultsReceived > 100);
bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE);
getChildView("classifieds_next")->setEnabled(show_next_button);
if (show_next_button)
{
rows -= (mResultsReceived - 100);
rows -= (mResultsReceived - RESULT_PAGE_SIZE);
}
return rows;
}
@ -2376,7 +2377,7 @@ void FSPanelSearchEvents::onBtnFind()
void FSPanelSearchEvents::onBtnNext()
{
mStartSearch += 100;
mStartSearch += RESULT_PAGE_SIZE;
getChildView("events_back")->setEnabled(TRUE);
find();
@ -2384,7 +2385,7 @@ void FSPanelSearchEvents::onBtnNext()
void FSPanelSearchEvents::onBtnBack()
{
mStartSearch -= 100;
mStartSearch -= RESULT_PAGE_SIZE;
getChildView("events_back")->setEnabled(mStartSearch > 0);
find();
@ -2451,11 +2452,11 @@ void FSPanelSearchEvents::setDay(S32 day)
S32 FSPanelSearchEvents::showNextButton(S32 rows)
{
bool show_next_button = (mResultsReceived > 100);
bool show_next_button = (mResultsReceived > RESULT_PAGE_SIZE);
getChildView("events_next")->setEnabled(show_next_button);
if (show_next_button)
{
rows -= (mResultsReceived - 100);
rows -= (mResultsReceived - RESULT_PAGE_SIZE);
}
return rows;
}