From a8b0b88d9fafa9d2fc9b515639dc1a5af1d9b28b Mon Sep 17 00:00:00 2001 From: Eugene Kurzberg Date: Mon, 18 Jul 2016 10:04:10 +0300 Subject: [PATCH] TSAM-6516 Count of contacts selected does not updated immediately Change-Id: Ibe1e9fc6aa17ce6838a1e879e22c93f4dace428b Signed-off-by: Eugene Kurzberg --- lib-contacts/src/Contacts/List/ListView.cpp | 9 +++++++++ lib-contacts/src/Contacts/List/PersonSearchItem.cpp | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib-contacts/src/Contacts/List/ListView.cpp b/lib-contacts/src/Contacts/List/ListView.cpp index 8a8fb01..ce2e9db 100644 --- a/lib-contacts/src/Contacts/List/ListView.cpp +++ b/lib-contacts/src/Contacts/List/ListView.cpp @@ -713,4 +713,13 @@ void ListView::onSearchChanged(const char *str) m_SearchProvider.search(str); elm_genlist_filter_set(m_Genlist->getEvasObject(), (void *) str); updateEmptyState(); + + if (!isSearching) { + for (auto &&group : m_PersonGroups) { + for (auto &&item : *group.second) { + PersonItem *personItem = static_cast(item); + personItem->setExcluded(false); + } + } + } } diff --git a/lib-contacts/src/Contacts/List/PersonSearchItem.cpp b/lib-contacts/src/Contacts/List/PersonSearchItem.cpp index 06c0c48..6c503ff 100644 --- a/lib-contacts/src/Contacts/List/PersonSearchItem.cpp +++ b/lib-contacts/src/Contacts/List/PersonSearchItem.cpp @@ -62,11 +62,9 @@ Eina_Bool PersonSearchItem::compare(Evas_Object *parent, void *filter) const char *str = (const char *) filter; if (str && *str) { bool isEqual = (bool) m_SearchData.getSearchResult(); - setExcluded(!isEqual); return isEqual; } - setExcluded(false); return true; } @@ -81,4 +79,5 @@ void PersonSearchItem::onSearchDataChanged() { elm_genlist_item_fields_update(getObjectItem(), PART_CONTACT_NAME, ELM_GENLIST_ITEM_FIELD_TEXT); elm_genlist_item_fields_update(getObjectItem(), PART_SUBTEXT, ELM_GENLIST_ITEM_FIELD_TEXT); + setExcluded(m_SearchData.getSearchResult() == nullptr); } -- 2.7.4