diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c
index b51d34d..b2f16e0 100644
--- a/obexd/plugins/phonebook-ebook.c
+++ b/obexd/plugins/phonebook-ebook.c
phonebook_entry_cb entry_cb;
phonebook_cache_ready_cb ready_cb;
EBookQuery *query;
- int count;
+ unsigned int count;
GString *buf;
char *id;
unsigned queued_calls;
{
struct query_context *data = user_data;
GList *l;
- unsigned int count = data->count, maxcount;
+ unsigned int count = 0, maxcount;
if (gerr != NULL) {
error("E-Book query failed: %s", gerr->message);
l = g_list_nth(contacts, data->params->liststartoffset);
- /* FIXME: Missing 0.vcf */
-
- for (; l && count < maxcount; l = g_list_next(l), count++) {
+ for (; l && count + data->count < maxcount; l = g_list_next(l),
+ count++) {
EContact *contact = E_CONTACT(l->data);
EVCard *evcard = E_VCARD(contact);
char *vcard;
g_free(vcard);
}
+ data->count += count;
+
done:
g_list_free_full(contacts, g_object_unref);
data->queued_calls--;
if (data->queued_calls == 0)
- data->contacts_cb(data->buf->str, data->buf->len, count, 0,
- TRUE, data->user_data);
+ data->contacts_cb(data->buf->str, data->buf->len, data->count,
+ 0, TRUE, data->user_data);
}
static void ebook_entry_cb(EBook *book, const GError *gerr,