TSAM-6516 Count of contacts selected does not updated immediately 55/80455/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 18 Jul 2016 07:04:10 +0000 (10:04 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 18 Jul 2016 07:04:10 +0000 (10:04 +0300)
Change-Id: Ibe1e9fc6aa17ce6838a1e879e22c93f4dace428b
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-contacts/src/Contacts/List/ListView.cpp
lib-contacts/src/Contacts/List/PersonSearchItem.cpp

index 8a8fb01..ce2e9db 100644 (file)
@@ -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<PersonItem *>(item);
+                               personItem->setExcluded(false);
+                       }
+               }
+       }
 }
index 06c0c48..6c503ff 100644 (file)
@@ -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);
 }