diff options
author | vng <viktor.govako@gmail.com> | 2014-07-24 21:15:16 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:21:51 +0300 |
commit | 4dda2e079c494dcb6524ddbf96135f0cadd75e16 (patch) | |
tree | 6bfa67323045f5693916e47e422459aca46c986e /qt/search_panel.cpp | |
parent | 3909bc8adce870bf1ce7f89078412d28994757e1 (diff) |
[search] Refactored emitting final search results.
Diffstat (limited to 'qt/search_panel.cpp')
-rw-r--r-- | qt/search_panel.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp index 0abdc96e8d..78cc1c181e 100644 --- a/qt/search_panel.cpp +++ b/qt/search_panel.cpp @@ -183,17 +183,17 @@ void SearchPanel::OnSearchPanelItemClicked(int row, int) { ASSERT_EQUAL(m_results.size(), static_cast<size_t>(m_pTable->rowCount()), ()); - if (m_results[row].GetResultType() != ResultT::RESULT_SUGGESTION) - { - // center viewport on clicked item - m_pDrawWidget->ShowSearchResult(m_results[row]); - } - else + if (m_results[row].IsSuggest()) { // insert suggestion into the search bar string const suggestion = m_results[row].GetSuggestionString(); m_pEditor->setText(QString::fromUtf8(suggestion.c_str())); } + else + { + // center viewport on clicked item + m_pDrawWidget->ShowSearchResult(m_results[row]); + } } void SearchPanel::hideEvent(QHideEvent *) |