Linux bluetooth development
 help / color / mirror / Atom feed
From: Lukasz Pawlik <lucas.pawlik@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Lukasz Pawlik <lucas.pawlik@gmail.com>
Subject: [PATCH] Fix problem with phonebook size
Date: Fri,  3 Sep 2010 12:21:51 +0200	[thread overview]
Message-ID: <1283509311-3965-1-git-send-email-lucas.pawlik@gmail.com> (raw)

This patch fix problem with phonebook size during phonebook
pull request. Now obexd "combine" the raw results from tracker DB
to match with that what phonebook pull returns.
---
 plugins/phonebook-tracker.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index bdd9587..2bb5c4f 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -842,13 +842,11 @@ static void pull_contacts(char **reply, int num_fields, void *user_data)
 
 	data->index++;
 
-	/* Just interested in knowing the phonebook size */
-	if (!data->vcardentry && params->maxlistcount == 0)
-		return;
-
 	last_index = params->liststartoffset + params->maxlistcount;
 
-	if (data->index <= params->liststartoffset || data->index > last_index)
+	if ((data->index <= params->liststartoffset ||
+			data->index > last_index) &&
+			params->maxlistcount > 0)
 		return;
 
 add_entry:
@@ -910,8 +908,9 @@ done:
 	vcards = gen_vcards(data->contacts, params);
 
 	if (num_fields == 0)
-		data->cb(vcards->str, vcards->len, data->index, 0,
-							data->user_data);
+		data->cb(vcards->str, vcards->len,
+				g_slist_length(data->contacts), 0,
+				data->user_data);
 
 	g_slist_free(data->contacts);
 	g_string_free(vcards, TRUE);
-- 
1.7.0.4


             reply	other threads:[~2010-09-03 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 10:21 Lukasz Pawlik [this message]
2010-09-06  7:02 ` [PATCH] Fix problem with phonebook size Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283509311-3965-1-git-send-email-lucas.pawlik@gmail.com \
    --to=lucas.pawlik@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox