data: increased autocomplete performance by caching and limiting results to 100

This commit is contained in:
Eberhard Graether
2015-10-27 14:22:45 +01:00
parent cbb6fcd8e2
commit c7a2533dc4
12 changed files with 76 additions and 40 deletions
+7 -2
View File
@@ -822,7 +822,7 @@ void QtSmartSearchBox::clearLineEdit()
void QtSmartSearchBox::requestAutoCompletions() const
{
MessageSearchAutocomplete("", text().toStdString()).dispatch();
MessageSearchAutocomplete(text().toStdString()).dispatch();
}
void QtSmartSearchBox::hideAutoCompletions()
@@ -832,5 +832,10 @@ void QtSmartSearchBox::hideAutoCompletions()
std::deque<SearchMatch> QtSmartSearchBox::getMatchesForInput(const std::string& text) const
{
return std::deque<SearchMatch>(1, SearchMatch(text));
std::deque<SearchMatch> matches;
if (text.size())
{
matches.push_back(SearchMatch(text));
}
return matches;
}