logic: Fixed issues in search
* fixed bad search performance when rescoring * fixed commands had no text in autocompletions * no autocompletions when entering fulltext search query * check query actuality before processing autocompletions
This commit is contained in:
@@ -66,6 +66,11 @@ QSize QtSearchBar::sizeHint() const
|
||||
return QSize(400, 100);
|
||||
}
|
||||
|
||||
QString QtSearchBar::query() const
|
||||
{
|
||||
return m_searchBox->text();
|
||||
}
|
||||
|
||||
void QtSearchBar::setMatches(const std::vector<SearchMatch>& matches)
|
||||
{
|
||||
m_searchBox->setMatches(matches);
|
||||
|
||||
@@ -22,6 +22,8 @@ public:
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
QString query() const;
|
||||
|
||||
void setMatches(const std::vector<SearchMatch>& matches);
|
||||
void setFocus();
|
||||
void findFulltext();
|
||||
|
||||
@@ -895,7 +895,7 @@ void QtSmartSearchBox::clearLineEdit()
|
||||
|
||||
void QtSmartSearchBox::requestAutoCompletions()
|
||||
{
|
||||
if (text().size())
|
||||
if (text().size() && !text().startsWith(SearchMatch::FULLTEXT_SEARCH_CHARACTER))
|
||||
{
|
||||
MessageSearchAutocomplete(text().toStdString()).dispatch();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@ void QtSearchView::refreshView()
|
||||
m_refreshViewFunctor();
|
||||
}
|
||||
|
||||
std::string QtSearchView::getQuery() const
|
||||
{
|
||||
return m_widget->query().toStdString();
|
||||
}
|
||||
|
||||
void QtSearchView::setMatches(const std::vector<SearchMatch>& matches)
|
||||
{
|
||||
m_setMatchesFunctor(matches);
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
virtual void refreshView();
|
||||
|
||||
// SearchView implementation
|
||||
virtual std::string getQuery() const;
|
||||
virtual void setMatches(const std::vector<SearchMatch>& matches);
|
||||
virtual void setFocus();
|
||||
virtual void findFulltext();
|
||||
|
||||
Reference in New Issue
Block a user