Index: athena/home/app_list_view_delegate.cc |
diff --git a/athena/home/app_list_view_delegate.cc b/athena/home/app_list_view_delegate.cc |
index 2938bf70af9ba344c6228fd2eb806092e3f8822b..bd85ecaaead5cb48ea36e5881e2457751d4e2fa8 100644 |
--- a/athena/home/app_list_view_delegate.cc |
+++ b/athena/home/app_list_view_delegate.cc |
@@ -51,9 +51,12 @@ void AppListViewDelegate::SearchResultChanged() { |
app_list::SearchProvider* search_provider = search_providers_[0]; |
std::vector<app_list::SearchResult*> results; |
search_provider->ReleaseResult(&results); |
- model_->results()->DeleteAll(); |
- for (size_t i = 0; i < results.size(); ++i) |
- model_->results()->Add(results[i]); |
+ if (results.empty()) { |
hashimoto
2014/08/04 11:28:54
This code assumes that |results| is empty iff Sear
Jun Mukai
2014/08/04 16:43:10
This is not enough. You should clear model_->resul
hashimoto
2014/08/05 01:03:35
Isn't calling model_->results()->DeleteAll() when
Jun Mukai
2014/08/05 07:33:22
You made the point.
|
+ model_->results()->DeleteAll(); |
+ } else { |
+ for (size_t i = 0; i < results.size(); ++i) |
+ model_->results()->Add(results[i]); |
+ } |
} |
bool AppListViewDelegate::ForceNativeDesktop() const { |