DBG("contacts_db_get_records_with_query = %d", ret);
RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_db_get_records_with_query failed: %s",get_contacts_error(ret));
- while (contacts_list_get_current_record_p(list, &record) == 0)
+ while (contacts_list_get_current_record_p(list, &record) == CONTACTS_ERROR_NONE)
{
+ int count;
// Get details
- ret = contacts_record_get_int(record, _contacts_person_usage.times_used, &usage_count);
+ ret = contacts_record_get_int(record, _contacts_person_usage.times_used, &count);
DBG("contacts_record_get_int = %d", ret);
RETVM_IF(ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NOT_SUPPORTED, NULL, "contacts_record_get_int failed: %s",get_contacts_error(ret));
+ usage_count += count;
DBG("Usage Count = %d", usage_count);
- sprintf(resultc, "Total call and messages made to Test is = %d", usage_count);
- ui_utils_label_set_text(this->info_label, resultc, "left");
-
- break;
+ ret = contacts_list_next(list);
+ if (ret != CONTACTS_ERROR_NONE)
+ break;
}
+ sprintf(resultc, "Total call and messages made to Test is = %d", usage_count);
+ ui_utils_label_set_text(this->info_label, resultc, "left");
elm_object_part_content_set(this->view->layout, "info_text", this->info_label);