Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-07-10 02:02:28 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:40:50 +0300
commitb6836459f3fd06a48ce5362432ba6a848e90e19d (patch)
tree47b34eaee2e6ad6d91d49debfeefbabc5875c3fb /qt/search_panel.cpp
parentd5340b798206a8e57b21743ecacf79fa53bbef00 (diff)
[desktop] Run progress only when needed.
Diffstat (limited to 'qt/search_panel.cpp')
-rw-r--r--qt/search_panel.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp
index 645092ce0a..a61e0a35f3 100644
--- a/qt/search_panel.cpp
+++ b/qt/search_panel.cpp
@@ -155,6 +155,7 @@ void SearchPanel::OnSearchResult(ResultsT * res)
}
delete res;
+
// stop search busy indicator
m_pAnimationTimer->stop();
m_pClearButton->setIcon(QIcon(":/ui/x.png"));
@@ -170,14 +171,15 @@ void SearchPanel::OnSearchTextChanged(QString const & str)
m_params.m_query = normalized.toUtf8().constData();
m_params.m_callback = bind(&SearchPanel::SearchResultThreadFunc, this, _1);
- m_pDrawWidget->Search(m_params);
+ if (m_pDrawWidget->Search(m_params))
+ {
+ // show busy indicator
+ if (!m_pAnimationTimer->isActive())
+ m_pAnimationTimer->start(200);
- // show busy indicator
- if (!m_pAnimationTimer->isActive())
- m_pAnimationTimer->start(200);
- OnAnimationTimer();
- m_pClearButton->setFlat(true);
- m_pClearButton->setVisible(true);
+ m_pClearButton->setFlat(true);
+ m_pClearButton->setVisible(true);
+ }
}
//else
//{