static void _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info);
static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static int _folder_get_favourite_mail_count(bool unread_only);
+
//static void _changed_cb(void *data, Evas_Object *obj, void *event_info);
//static void _focused_cb(void *data, Evas_Object *obj, void *event_info);
//static void _unfocused_cb(void *data, Evas_Object *obj, void *event_info);
ug_data->all_acc_unread_count[ACC_MAILBOX_TYPE_OUTBOX] += mailbox_list[j].unread_count;
}
break;
- case EMAIL_MAILBOX_TYPE_FLAGGED:
- {
- ug_data->all_acc_read_count[ACC_MAILBOX_TYPE_FLAGGED] += mailbox_list[j].total_mail_count_on_local;
- ug_data->all_acc_unread_count[ACC_MAILBOX_TYPE_FLAGGED] += mailbox_list[j].unread_count;
- }
- break;
+
default:
break;
}
_make_folder_tree(alist + i, ug_data);
}
+ ug_data->all_acc_read_count[ACC_MAILBOX_TYPE_FLAGGED] = _folder_get_favourite_mail_count(false);
+ ug_data->all_acc_unread_count[ACC_MAILBOX_TYPE_FLAGGED] = _folder_get_favourite_mail_count(true);
+
ug_data->alist = alist;
}
else
return FALSE;
}
+static int _folder_get_favourite_mail_count(bool unread_only)
+{
+ debug_enter();
+
+ email_mail_list_item_t *mail_list = NULL;
+ email_list_filter_t *filter_list = NULL;
+ int cnt_filter_list = 1;
+ int mail_count = 0;
+ int err = 0;
+ int i = 0;
+
+ if(unread_only)
+ cnt_filter_list = cnt_filter_list + 2;
+
+ filter_list = malloc(sizeof(email_list_filter_t) * cnt_filter_list);
+ memset(filter_list, 0, sizeof(email_list_filter_t) * cnt_filter_list);
+
+ filter_list[i].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ filter_list[i].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_FLAGS_FLAGGED_FIELD;
+ filter_list[i].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_EQUAL;
+ filter_list[i].list_filter_item.rule.key_value.integer_type_value = 1;
+ i++;
+
+ if(unread_only) {
+ filter_list[i].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_OPERATOR;
+ filter_list[i].list_filter_item.operator_type = EMAIL_LIST_FILTER_OPERATOR_AND;
+ i++;
+
+ filter_list[i].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ filter_list[i].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_FLAGS_SEEN_FIELD;
+ filter_list[i].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_EQUAL;
+ filter_list[i].list_filter_item.rule.key_value.integer_type_value = 0;
+ i++;
+
+ }
+
+ err = email_get_mail_list_ex(filter_list, cnt_filter_list, NULL, 0, -1, -1, &mail_list, &mail_count);
+ if (err != EMAIL_ERROR_NONE)
+ debug_warning("email_get_mail_list_ex - err (%d)", err);
+
+ email_free_list_filter(&filter_list, cnt_filter_list);
+
+ debug_warning("mail_count(%d)", mail_count);
+ FREE(mail_list);
+
+ return mail_count;
+}
// Codes for removing elm_editfield : START
/*