Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Fix problem with phonebook size
@ 2010-09-03 10:21 Lukasz Pawlik
  2010-09-06  7:02 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Pawlik @ 2010-09-03 10:21 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lukasz Pawlik

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix problem with phonebook size
  2010-09-03 10:21 [PATCH] Fix problem with phonebook size Lukasz Pawlik
@ 2010-09-06  7:02 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-09-06  7:02 UTC (permalink / raw)
  To: Lukasz Pawlik; +Cc: linux-bluetooth

Hi Lukasz,

On Fri, Sep 03, 2010, Lukasz Pawlik wrote:
> 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(-)

Thanks. The patch is now upstream.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-06  7:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 10:21 [PATCH] Fix problem with phonebook size Lukasz Pawlik
2010-09-06  7:02 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox